Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

No module named maskrcnn_benchmark.config #22

Closed
yaoliUoA opened this issue Oct 25, 2018 · 15 comments
Closed

No module named maskrcnn_benchmark.config #22

yaoliUoA opened this issue Oct 25, 2018 · 15 comments

Comments

@yaoliUoA
Copy link

❓ Questions and Help

Hi
I have followed the instructions to install this package. However, when I run the notebook demo under './demo', it gives an error:

ImportError: No module named maskrcnn_benchmark.config.

@Kongsea
Copy link
Contributor

Kongsea commented Oct 26, 2018

Use python 3.x.

@jiapei100
Copy link

@Kongsea
I've got the same ERROR message, but I'm using python 3.6.6

$ python --version
Python 3.6.6

Any other suggestions?

@yaoliUoA
Copy link
Author

@jiapei100 I found the solution. You need to create an empty __init__.py under the folder "maskrcnn_benchmark".

@moyans
Copy link

moyans commented Oct 26, 2018

Traceback (most recent call last):
File "webcam.py", line 6, in
from predictor import COCODemo
File "/data/Data/HeiRen/code/maskrcnn-benchmark/demo/predictor.py", line 7, in
from maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer
File "/data/Data/HeiRen/code/maskrcnn-benchmark/maskrcnn_benchmark/utils/checkpoint.py", line 7, in
from maskrcnn_benchmark.utils.model_serialization import load_state_dict
File "/data/Data/HeiRen/code/maskrcnn-benchmark/maskrcnn_benchmark/utils/model_serialization.py", line 7, in
from maskrcnn_benchmark.utils.imports import import_file
File "/data/Data/HeiRen/code/maskrcnn-benchmark/maskrcnn_benchmark/utils/imports.py", line 3, in
import importlib.util
ImportError: No module named util

@fmassa
Copy link
Contributor

fmassa commented Oct 26, 2018

I am adding support for Python 2 in #11 and it should fix the errors you are seeing.

I'll verify that the training that I launched yesterday matches the excepted accuracies and I'll merge it

@fmassa
Copy link
Contributor

fmassa commented Oct 26, 2018

For info, I've just merged #11 , so the codebase should work with Python 2 as well.

@fmassa
Copy link
Contributor

fmassa commented Oct 26, 2018

Let me know if you still face problems after pulling from latest version of maskrcnn-benchmark

@hitchhooker
Copy link

this is caused by not using conda. after creating new conda name you need to always use source activate name_u_gave to not get this error.

conda create --name maskrcnn_benchmark
source activate maskrcnn_benchmark

@fmassa
Copy link
Contributor

fmassa commented Oct 26, 2018

yes, I've improved the documentation to add the source activate maskrcnn_benchmark after creating the environemnt

@jiapei100
Copy link

@fmassa
Nope... I didn't use conda at all....

@yaoliUoA
I've added init.py under the folder maskrcnn_benchmark, but the ERROR continues....

@fmassa
Copy link
Contributor

fmassa commented Oct 26, 2018

Make sure that the installation wmis done properly
Also, pull from latest master, I've fixed the missing __init__.py files

As a note, having conda is a very easy and simple way of managing several python environments, and I'd highly recommend it.

@moyans
Copy link

moyans commented Oct 29, 2018

when i use 3.x python with conda, every thing is all right.

@Kongsea
Copy link
Contributor

Kongsea commented Oct 29, 2018

@moyans me too.

@fmassa
Copy link
Contributor

fmassa commented Oct 29, 2018

We now support python2 as well, so if it wasn't working before with Python 2, now it should be.

@Maosef
Copy link

Maosef commented Dec 12, 2018

I had the same issue, trying this link helped: jupyter/notebook#1524

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

No branches or pull requests

7 participants