Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

Import error no module name samples.balloon

Open tabelh opened this issue 5 years ago • 4 comments

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.

tabelh avatar Mar 15 '19 15:03 tabelh

For me, adding init.py to both directories is not working.

XiaoqianSun0104 avatar Jul 29 '19 23:07 XiaoqianSun0104

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 _ _

leberber avatar Dec 09 '20 19:12 leberber

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.

bfhaha avatar Jun 14 '21 07:06 bfhaha

import the whole project directory using import os os.chdir("your project directory path")

dayana123456789 avatar Sep 13 '23 08:09 dayana123456789