Skip to content

Error and warning when running eval.py and detect.py #42

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

Closed
StrongerzZ opened this issue Feb 29, 2020 · 2 comments
Closed

Error and warning when running eval.py and detect.py #42

StrongerzZ opened this issue Feb 29, 2020 · 2 comments

Comments

@StrongerzZ
Copy link

Error when running eval.py and detect.py:
File "D:\NNDL_pytorch\a-PyTorch-Tutorial-to-Object-Detection-master\model.py", line 499, in detect_objects
suppress = torch.max(suppress, overlap[box] > max_overlap)
RuntimeError: Expected object of scalar type Byte but got scalar type Bool for argument #2 'other'

Is there a problem with the use of torch.max()?

Warning when running eval.py and detect.py:
G:\NNDL\Anaconda3\envs\SSD\lib\site-packages\torch\serialization.py:453: SourceChangeWarning: source code of class 'model.SSD300' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
G:\NNDL\Anaconda3\envs\SSD\lib\site-packages\torch\serialization.py:453: SourceChangeWarning: source code of class 'model.VGGBase' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)

Can someone help me solve this?
I use python3.7.6 and pytorch1.2.0
Thanks a lot!

@JerryLi06
Copy link

I solved the same problem by refering to #24. You may have a try

@StrongerzZ
Copy link
Author

I solved the same problem by refering to #24. You may have a try

It works, Thanks a lot!

I solved it by another way:
temp_suppress = overlap[box] > max_overlap
suppress = (temp_suppress | suppress.bool()).byte()

But there are new warnings in both ways:
UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

Can you help me solve it?
It appears very often when I run eval.py, and not convenient to see the progress bar (tqdm).

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

No branches or pull requests

2 participants