matteorr/coco-analyze

ImportError

Jeff-sjtu opened this issue · 1 comments

Hi,
When I run COCOanalyze_demo.ipynb in jupyter notebook, there is an Import Error

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-3e23b1a80e3d> in <module>()
      4 
      5 ## COCO imports
----> 6 from pycocotools.coco import COCO
      7 from pycocotools.cocoeval import COCOeval
      8 from pycocotools.cocoanalyze import COCOanalyze

/home/jeff/coco-analyze/pycocotools/coco.py in <module>()
     53 import copy
     54 import itertools
---> 55 from . import mask as maskUtils
     56 import os
     57 from collections import defaultdict

/home/jeff/coco-analyze/pycocotools/mask.py in <module>()
      1 __author__ = 'tsungyi'
      2 
----> 3 import pycocotools._mask as _mask
      4 
      5 # Interface for manipulating masks stored in RLE format.

ImportError: No module named _mask

regards

Hi, this error occurs because you are not able to import the module _mask from the standard coco API (from pycocotools.coco import COCO), not when you import COCOanalyze.

Make sure you follow the instructions on their github page, and install the cocoAPi correctly, after that my code will work without any addition needed.

In particular, have you run the command python setup.py build_ext --inplace, as indicated here?