Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name '_mask' from 'pycocotools' #8

Open
Bryce1010 opened this issue Jan 7, 2020 · 2 comments
Open

ImportError: cannot import name '_mask' from 'pycocotools' #8

Bryce1010 opened this issue Jan 7, 2020 · 2 comments

Comments

@Bryce1010
Copy link

Hi, thanks for your work at first.
But when I reimplement your results, I faced some errors.
After I clone the repo, I run the command :
python setup.py build develop

My envirionment is python3.7 and PyTorch1.1.
Then, when I run the code, there is some errors:
ImportError: cannot import name '_mask' from 'pycocotools' (/home/xyang/Code/practical/Few-shot/One-Shot-Object-Detection/lib/pycocotools/__init__.py)
I don't know if I need to run the setup.py with py2?

@CashewMIC
Copy link

CashewMIC commented Jan 8, 2020

Hey! I met this issue too. I get new cocoapi files here and install it following the instruction separately ,then the test.py works well.(Not sure about train ,i diden't try it :))
P.S. take care the pathes of those files
P.S.. not native speaker ,hope you can understand :)
P.S... python3.6 pytorch 1.0

@RajathRD
Copy link

Another thing that worked for me was installing pycocotools from :
https://github.com/philferriere/cocoapi - the installation was pretty straightforward.

Make sure to delete lib/pycocotools so that the imports point at the pip version and not the local version.

After the installation - You might need to convert the np.round(...) to integer in cocoeval.py -> Params.setDetParams and Params.getKpParams, wherever you installed it with pip.

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

No branches or pull requests

3 participants