Mask_RCNN
Mask_RCNN copied to clipboard
Import error no module name samples.balloon
Hello, not sure if this should be a pull request or not. Pretty new to github and coding in general.
I encountered an issue when trying to run the inspect_balloon_model.ipynb
when trying to run the notebook it gave me the error that samples.balloon was not a module that could be imported. I fixed this by adding __init__.py
files to both directories
I tried installing the setup file with both python2 and 3, but this made no difference.
Just thought I'd share my experiences in case others run into the same problem.
For me, adding init.py to both directories is not working.
This is what worked for me. 1- extract the balloon folder from the sample folder and put it in the Mask_RCNN 2- import it as follows: from balloon import _ _
Hello. I moved the file balloon.py
from /Mask_RCNN/samples/balloon/
to /Maks_RCNN/samples
and changed the command
from samples.balloon import balloon
to
from samples import balloon
But it showed the message
ImportError: cannot import name 'balloon' from 'samples' (/usr/local/lib/python3.7/dist-packages/samples/__init__.py)
So I moved the file to /Mask_RCNN/mrcnn
(where has the file __init__.py
)
and used the command
from mrcnn import balloon
Then the message has gone.
import the whole project directory using import os os.chdir("your project directory path")