Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error on loading custom trained model #1856

Closed
p9anand opened this issue Jan 6, 2021 · 3 comments
Closed

Getting error on loading custom trained model #1856

p9anand opened this issue Jan 6, 2021 · 3 comments
Labels
bug Something isn't working Stale

Comments

@p9anand
Copy link

p9anand commented Jan 6, 2021

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Input:

import torch

a = torch.tensor([5])
c = a / 0

Output:

Traceback (most recent call last):
  File "/Users/glennjocher/opt/anaconda3/envs/env1/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-be04c762b799>", line 5, in <module>
    c = a / 0
RuntimeError: ZeroDivisionError

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

  • OS: [e.g. Ubuntu]
  • GPU [e.g. 2080 Ti]

Additional context

Add any other context about the problem here.

image

and got following error:
image

image

image

@p9anand p9anand added the bug Something isn't working label Jan 6, 2021
@p9anand
Copy link
Author

p9anand commented Jan 6, 2021

I was able to load the weights file. but it seems for some layers number of parameters are zero and because of this performance of the model has degraded. Is there way to go back to previous version of loading custom model in pytorch hub.

image

@glenn-jocher
Copy link
Member

glenn-jocher commented Jan 7, 2021

@p9anand see PyTorch Hub tutorial for instructions on custom model loading:
https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading

It's very simple:

Custom Models

This example loads a custom 20-class VOC-trained YOLOv5s model 'yolov5s_voc_best.pt' with PyTorch Hub.

model = torch.hub.load('ultralytics/yolov5', 'custom', path_or_model='yolov5s_voc_best.pt')  # custom model

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants