(maskrcnn_benchmark) python@cse-w1:~/maskrcnn-benchmark$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
import torch
print(torch.__version__)
1.1.0.dev20190501cuda ver: 10.1
ModuleNotFoundError Traceback (most recent call last)
----> 1 from maskrcnn_benchmark.config import cfg
2 from predictor import COCODemo
ModuleNotFoundError: No module named 'maskrcnn_benchmark'
while running the demo
Hello Vellala, try to add __init__.py in the maskrcnn_benchmark folder and try again.
I am assuming you followed either option 1 or option 2 of the install.md successfully
@knaggita
Yes, i am following option1, I even tried option2 i still get the same error
i have added __init__.py file in the maskrcnn_benchmark folder, yet i get the same error.
do i need to redo the steps in install.md file?
Hi @VellalaVineethKumar Did you every find the fix to this? I am running into the same thing.
I think this is because you are not under the correct folder and you need to : cd maskrcnn-benchmark.
I am in demo folder as instructed in README.md. Also, I am using python 3.6.8 but still I'm getting this error. What mistake I can be making!
I was in the right directory and I never was able to get this working. I was able to get the dockerized demo working but had to make some changes. I have an open PR for the changes if you just want to checkout that version and run. My team just ended up using the new release of torch vision at the end of the day. Hope that helps.
Thanks for the reply. I want to get this thing working in any way possible. But I don't have any idea of open PR. What it actually is!
Does your computer have a camera? Does it cause the problem?
Yes i had the camera but the issue has been resolved now. Actually, torch was automatically getting installed on installing torchvisionorch and hence torch was creating problems (as it was conflicting with torch-nightly. It worked fine after i uninstalled torch using pip.
Hey! I run into the same problem, just adding the maskrcnn_benchmark path to sys.path it worked for me. You need to first import sys and then to append to the path list the path to maskrcnn_benchmark, in my case: sys.path.append("/home/victor/Documents/maskrcnn-benchmark").
Hope it helps :)
Hey! I run into the same problem, just adding the
maskrcnn_benchmarkpath tosys.pathit worked for me. You need to first importsysand then to append to the path list the path tomaskrcnn_benchmark, in my case:sys.path.append("/home/victor/Documents/maskrcnn-benchmark").Hope it helps :)
Thanks a lot that my problem has been solved. And I have one more point emphasize: Don't use like this: sys.path.append("~/xxx"). It should be absolute path otherwise the same problem occurs.
Most helpful comment
Hey! I run into the same problem, just adding the
maskrcnn_benchmarkpath tosys.pathit worked for me. You need to first importsysand then to append to the path list the path tomaskrcnn_benchmark, in my case:sys.path.append("/home/victor/Documents/maskrcnn-benchmark").Hope it helps :)