Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

ModuleNotFoundError when running demo

Open leeQT opened this issue 6 years ago • 13 comments

When I ran demo.ipynb, I got "ModuleNotFoundError: No module named 'mrcnn'" in line 15, "from mrcnn import utils" . I tried the solution in https://github.com/matterport/Mask_RCNN/issues/413, which is running "python setup.py install", but that error still exists. I checked my packages and I'm sure that I have already installed mrcnn.

leeQT avatar Sep 06 '18 13:09 leeQT

you are missing the folder mrcnn which has the utils.py file. Try to download the repo again.

fastlater avatar Sep 07 '18 00:09 fastlater

I checked the folder, it has utils.py in it. I downloaded the repo "Mask_RCNN" again and that error didn't disappear. It really confuses me.

leeQT avatar Sep 07 '18 03:09 leeQT

If folder is placed in a location where the script is running, script should find it. At least, you should get something like a method error and not the moduleNotfound error

main folder should include (at least): ----demo.ipynb ----mrcnn>>>utils.py

fastlater avatar Sep 07 '18 03:09 fastlater

The file organization is correct. I'm using Anaconda, the envs folder is in disk D but the repo I downloaded is in disk C, could that be the reason? But I tried to put folder Mask_RCNN and cocoapi in envs/MaskRCNN(the environment I created for this project), the result is still the same.

leeQT avatar Sep 07 '18 03:09 leeQT

Has anyone found an answer to this. I am having the same problem.

johncleveland avatar Feb 01 '19 04:02 johncleveland

I have the same problem. Has anyone solved this?

PallawiSinghal avatar Apr 17 '19 06:04 PallawiSinghal

I solved this by copying the mrcnn folder from the Mask_RCNN directory and pasting it into the root directory. This works because the code is searching for a module in the root directory, so you need to actually manually change the location of the module to the root directory.

carolynenewman avatar Jul 01 '19 18:07 carolynenewman

hey 2019 and still i have the same problem..any solution pls!!

khalideyez avatar Aug 27 '19 06:08 khalideyez

Just check in which folder you are in, in Jupyter. You should be in Mask_RCNN and not inside it in sample folder.

Ankitjaiswal1201 avatar Sep 06 '19 21:09 Ankitjaiswal1201

@Ankitjaiswal1201 thanks. Indeed the problem originated from the root directory(Folder in which I was referring to)

Beltus avatar Jul 01 '20 08:07 Beltus

So i have the same problem. I am trying to run it on spyder. and I am in F drive, Mask_RCNN folder. Any help? I do change the working directory but it goes back into mrcnn

Haadia-a avatar Nov 16 '20 16:11 Haadia-a

Try I got the solution Try !pip install mrcnn

!pip install --upgrade h5py==2.10.0 !pip install mrcnn !git clone https://github.com/DJ-Manjaray/Deeraj-Mask-R-CNN.git

DJ-Manjaray-zz avatar Sep 29 '21 16:09 DJ-Manjaray-zz

@carolynenewman I am trying to run the repo (https://github.com/RaiyaniNirav/Mask-R-CNN-for-water-detection) on VSCode. I am still facing the issue. I tried moving the mrcnn folder to both the root directory and also to the directory where the VSCode project is getting saved. The issue persists. I even tried updating Tensorflow and Keras, according to a suggestion. Can anyone suggest please that what am I missing here?

Tawheed094 avatar May 05 '22 19:05 Tawheed094