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

Pytorch 1.2 compatible #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nesvera
Copy link

@nesvera nesvera commented Sep 25, 2019

Nice tutorial. It helped me a lot while I was learning about the implementation of SSD, thanks :D

I encountered the following error when I tried to use your code with pytorch 1.2

Traceback (most recent call last):
File "eval.py", line 88, in
evaluate(test_loader, model)
File "eval.py", line 63, in evaluate top_k=200)
File "/home/feaf-seat-1/Documents/nesvera/object_detection/a-PyTorch-Tutorial-to-Object-Detection/model.py", line 494, 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'

I changed some lines of the model.py code to be able to run the code with pytorch 1.2. Now, it is compatible with both versions: 0.4 and 1.2.

Beyond, I created an algorithm to make predictions from a video (based in your detect code), and I noticed that the FPS increase almost 2 times using pytorch 1.2.

Running on a Quadro M5000, I achieved the following results:
pytorch 0.4 (original code)

  • detect.py = Mean Average Precision (mAP): 0.739
  • detect_video.py = ~19 FPS

pytorch 1.2 (modified code)

  • detect.py = Mean Average Precision (mAP): 0.739
  • detect_video.py = ~35 FPS

I didn't know exactly if the increase of the FPS comes from the code (that was changed from uint8 to bool), or it comes from the pytorch upgrade. Probably the latter.

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

Successfully merging this pull request may close these issues.

None yet

1 participant