Skip to content
New issue

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

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

Already on GitHub? # to your account

Class_name is not defined... #2

Open
mubeenmeo344 opened this issue Mar 28, 2020 · 2 comments
Open

Class_name is not defined... #2

mubeenmeo344 opened this issue Mar 28, 2020 · 2 comments

Comments

@mubeenmeo344
Copy link

NameError Traceback (most recent call last)
in ()
----> 1 inferenceing_function(img_path)

1 frames
in model_inference_results()
27 confidence, clas = expp.topk(1, dim=1)
28
---> 29 return f'Class: {class_name[clas]}', f'Confidence score: {confidence.item()}'
30
31

NameError: name 'class_name' is not defined

@aliyevorkhan
Copy link

Probably this problem occurs by torch version. I got same error but when I downgrade torch and torchvision I compiled successfully.
I think model compiled by old torch version. So model variables does not match any new version of pytorch.

@shashwat1225
Copy link

What version exactly?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants