Skip to content

Out of date project? Unable to setup demo #57

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

Open
alexkutsan opened this issue Oct 13, 2022 · 1 comment
Open

Out of date project? Unable to setup demo #57

alexkutsan opened this issue Oct 13, 2022 · 1 comment

Comments

@alexkutsan
Copy link

I was trying to setup the demo locally but it does not work:

root@alex-OMEN:/opt/company/siam-mot# pip3 install -r requirements.txt
...
root@alex-OMEN:/opt/company/siam-mot# python3 demos/demo.py --demo-video ../long_video.mp4 --track-class  person_vehicel -dump-video True 
Traceback (most recent call last):
  File "demos/demo.py", line 5, in <module>
    from demos.demo_inference import DemoInference
ModuleNotFoundError: No module named 'demos'

Then I copied demo.py to the root of project and try again :

root@alex-OMEN:/opt/company/siam-mot# python3 demo.py --demo-video ../long_video.mp4 --track-class  person_vehicel -dump-video True 
Traceback (most recent call last):
  File "demo.py", line 5, in <module>
    from demos.demo_inference import DemoInference
  File "/opt/company/siam-mot/demos/demo_inference.py", line 10, in <module>
    from maskrcnn_benchmark.structures.bounding_box import BoxList
ModuleNotFoundError: No module named 'maskrcnn_benchmark'

I installed maskrcnn according to https://github.com/facebookresearch/maskrcnn-benchmark/blob/main/INSTALL.md

And the current error is :

root@alex-OMEN:/opt/company/siam-mot# python3 demo.py --demo-video ../long_video.mp4 --track-class  person_vehicel -dump-video True 
Traceback (most recent call last):
  File "demo.py", line 5, in <module>
    from demos.demo_inference import DemoInference
  File "/opt/company/siam-mot/demos/demo_inference.py", line 11, in <module>
    from maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer
  File "/usr/local/lib/python3.8/dist-packages/maskrcnn_benchmark-0.1-py3.8-linux-x86_64.egg/maskrcnn_benchmark/utils/checkpoint.py", line 7, in <module>
    from maskrcnn_benchmark.utils.model_serialization import load_state_dict
  File "/usr/local/lib/python3.8/dist-packages/maskrcnn_benchmark-0.1-py3.8-linux-x86_64.egg/maskrcnn_benchmark/utils/model_serialization.py", line 7, in <module>
    from maskrcnn_benchmark.utils.imports import import_file
  File "/usr/local/lib/python3.8/dist-packages/maskrcnn_benchmark-0.1-py3.8-linux-x86_64.egg/maskrcnn_benchmark/utils/imports.py", line 4, in <module>
    if torch._six.PY3:
AttributeError: module 'torch._six' has no attribute 'PY3'

What am I doing wrong?
Is this project still actual?

@KristynaJanku
Copy link

The problem is that you are using a newer version of PyTorch than the one maskrcnn_benchmark was made for, which no longer has that attribute, so the Python version has to be checked differently.

When I was setting this up with PyTorch 1.10.2, I got it working by changing the maskrcnn_benchmark/utils/import.py file like this:

Replace the original

if torch._six.PY3:

with this

import sys

if sys.version_info[0] == 3:

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