No module named 'maskrcnn_benchmark.modeling'
Xachap opened this issue · 7 comments
Hi,
I have followed the installation steps (and obviously all the prerequirements), but when I try to execute the example
python3 zed_object_detection.py --config-file /configs/caffe2/e2e_mask_rcnn_R_50_C4_1x_caffe2.yaml --min-image-size 256
I get this error:
user@user-pc:~/zed2/zed-pytorch$ sudo python3 zed_object_detection.py --config-file /configs/caffe2/e2e_mask_rcnn_R_50_C4_1x_caffe2.yaml --min-image-size 256 Traceback (most recent call last): File "zed_object_detection.py", line 6, in <module> from predictor import COCODemo File "/home/user/zed2/zed-pytorch/predictor.py", line 6, in <module> from maskrcnn_benchmark.modeling.detector import build_detection_model ModuleNotFoundError: No module named 'maskrcnn_benchmark.modeling'
I have used pip3 and my OS is Ubuntu 18.04
Thank you very much in advanced!
Hi
So you used pip to install the dependencies, did you install also install MaskRCNN with "sudo"? eg :
(sudo) python3 setup.py install
You don't have to, but if you did, it should match the command used to launch it ((sudo) python3 zed_object_detection.py
). Since the package installation locations are not shared, it won't be able to find the package.
Hello @adujardin, I guess the main problem is inside zed_object_detection.py file. Inside the file, you are trying to import COCOdemo from predictor.py file which is inside maskrcnn directory. So inside predictor.py file, you are trying to import maskrcnn_benchmark.--.-- files which don't even exist. These files exist inside maskrcnn directory of zed-pytorch repo, not maskrcnn_benchmark directory of facebook_research repo.
I am experiencing the error below. I have a Jetson AGX, running JP 4.3, ZED SDK 3.1. I installed PyTorch v1.4.0 & torchvision v0.5 via the NVIDIA prebuilt packages on the NVIDIA website. I have tried 3 clean installs, each time I executed the setup.py located in the zed-pytorch root. I have also tried the other suggestions on this forum and also anything else I could find online.
I have read that there is a known deficiency with pytorch versions greater than 1.1 that try to leverage maskrcnn_benchmark.____.
Happy to provide more info if needed.
pi@agx:~/torchvision/zed-pytorch$ sudo python3 zed_object_detection.py --config-file configs/caffe2/e2e_mask_rcnn_R_50_C4_1x_caffe2.yaml --min-image-size 256
Traceback (most recent call last):
File "zed_object_detection.py", line 6, in
from predictor import COCODemo
File "/home/pi/torchvision/zed-pytorch/predictor.py", line 6, in
from maskrcnn_benchmark.modeling.detector import build_detection_model
ModuleNotFoundError: No module named 'maskrcnn_benchmark.modeling'
I had a problem, but I was able to solve it. I solved it by cloning the repository facebook_researchand running setup.py in it.
I had a problem, but I was able to solve it. I solved it by cloning the repository facebook_researchand running setup.py in it.
This way solves my problem. thx!!
I had a problem, but I was able to solve it. I solved it by cloning the repository facebook_researchand running setup.py in it.
This works.
BTW, if you encounter 'deform_conv_cuda.cu(954): error: identifier "AT_CHECK" is undefined' problem when building maskrcnn-benchmark sourcecode, refer to issue, replace all the “AT_CHECK” with “TORCH_CHECK” in deform_conv_cuda.cu and deform_pool_cuda.cu in csrc/cuda.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days