Mmdetection: AttributeError: module 'pycocotools' has no attribute '__version__'

Created on 14 Sep 2020  路  6Comments  路  Source: open-mmlab/mmdetection

Hi, I installed mmdet according to the instructions, but I still encountered this problem.

File "/home/lijiale/mmdet_install/mmdetection/mmdet/datasets/coco.py", line 19, in
assert pycocotools.__version__ >= '12.0.2'
AttributeError: module 'pycocotools' has no attribute '__version__'

I also tried to install pycocotools from open-mmlab/cocoapi, but I found that it installed mmpycocotools. When I run _pip list | grep pycocotools_, I found that there are two pycocotools.

(open-mmlab) lijiale@ImageLab:~/mmdet_install/mmdetection3d$ pip list | grep pycocotools
mmpycocotools 12.0.2
pycocotools 2.0.2

Maybe this is the problem, but I don't know the specific reason. Could someone help me?

Most helpful comment

Hey @ZwwWayne, when I install mmpycocotools, I get back the error ModuleNotFoundError: No module named 'pycocotools'
Would be great if you can help me out.

Hey, I got this problem too. I solved it by uninstall mmpycocotools, and install it again.
Hope can help you!

All 6 comments

pip uninstall pycocotools

Please use the mmlab maintained pycocotools. To do that, you should first pip uninstall pycocotools and pip install mmpycocotools.

import pycocotools pycocotools.__file__, to locate the pycocotools path which is used in current python environment. Then uninstall it.

Hey @ZwwWayne, when I install mmpycocotools, I get back the error ModuleNotFoundError: No module named 'pycocotools'
Would be great if you can help me out.

Hey @ZwwWayne, when I install mmpycocotools, I get back the error ModuleNotFoundError: No module named 'pycocotools'
Would be great if you can help me out.

Hey, I got this problem too. I solved it by uninstall mmpycocotools, and install it again.
Hope can help you!

Hey @ZwwWayne, when I install mmpycocotools, I get back the error ModuleNotFoundError: No module named 'pycocotools'
Would be great if you can help me out.

Hey, I got this problem too. I solved it by uninstall mmpycocotools, and install it again.
Hope can help you!

it works for me! thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fmassa picture fmassa  路  3Comments

michaelisc picture michaelisc  路  3Comments

FrankXinqi picture FrankXinqi  路  3Comments

fatLime picture fatLime  路  3Comments

yangcong955 picture yangcong955  路  3Comments