ImportError: cannot import name '_mask' from 'pycocotools'
how can I fix it? thanks.
a silly workaround is just commenting out
# import pycocotools._mask as _mask
from
lib/pycocotools/coco.py
lib/pycocotools/cocoeval.py
lib/datasets/coco.py
since this repo doesn't use masks..
a silly workaround is just commenting out
# import pycocotools._mask as _maskfrom
lib/pycocotools/coco.py
lib/pycocotools/cocoeval.py
lib/datasets/coco.py
since this repo doesn't use masks..
So ... is this indeed a feasible and correct way to solve this problem?
And why there is the code import pycocotools._mask as _mask if it doesn't use masks?
My take is that masks are used for instance segmentation tasks and not detection tasks. That's why you can simply comment out and still work frcnn😇
My take is that masks are used for instance segmentation tasks and not detection tasks. That's why you can simply comment out and still work frcnn😇
なるほど…僕の理解がずれてました…
ちなみにコメントアウトするべき
import pycocotools._mask as _maskが
lib/pycocotools/coco.py
lib/pycocotools/cocoeval.py
lib/datasets/coco.py
で見つからないです。
すみませんが何故でしょうか?
You can install pycoctools with mask module compiled via conda or pip.
In other hand, you can compile _mask module from .pyx file with cython.
@shirui-japina
pycocotools should be where you installed with pip or whatever.
you should modify the coco.py script.
Another good workaround is installing pycocotools properly.
Try:
pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
This should work for Linux.
You can install
pycoctoolswith _mask_ module compiled via conda or pip.In other hand, you can compile _mask module from .pyx file with cython.
Thanks for your comment.
I tried to
pip install pycocotools
but got error as below:
Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
So then I installed _Visual Studio_, but it doesn't work.
Do you know what I should do now?
@shirui-japina
pycocotools should be where you installed with pip or whatever.
you should modify the coco.py script.
Thanks for your comment.
I'll try to install pycocotools.
Most helpful comment
a silly workaround is just commenting out
# import pycocotools._mask as _maskfrom
lib/pycocotools/coco.py
lib/pycocotools/cocoeval.py
lib/datasets/coco.py
since this repo doesn't use masks..