datitran / raccoon_dataset

The dataset is used to train my own raccoon detector and I blogged about it on Medium
https://medium.com/towards-data-science/how-to-train-your-own-object-detector-with-tensorflows-object-detector-api-bec72ecfe1d9
MIT License
1.27k stars 977 forks source link

ModuleNotFoundError: No module named 'pycocotools._mask #48

Open aliBUT opened 6 years ago

aliBUT commented 6 years ago

C:\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype fromfloattonp.floatingis deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "eval.py", line 50, in <module> from object_detection import evaluator File "C:\Continuum\research\object_detection\evaluator.py", line 27, in <module> from object_detection.metrics import coco_evaluation File "C:\Continuum\research\object_detection\metrics\coco_evaluation.py", line 20, in <module> from object_detection.metrics import coco_tools File "C:\Continuum\research\object_detection\metrics\coco_tools.py", line 47, in <module> from pycocotools import coco File "C:\Continuum\research\pycocotools\coco.py", line 55, in <module> from . import mask as maskUtils File "C:\Continuum\research\pycocotools\mask.py", line 3, in <module> import pycocotools._mask as _mask ModuleNotFoundError: No module named 'pycocotools._mask'

Hi i am following your tutorial , When i try to run eval.py script i get this error . Training script is working fine and all the scripts before eval.py

aliBUT commented 6 years ago

@datitran any idea why this is happening?

FalcoGer commented 6 years ago

It ran fine on tf version 1.4, i recently updated to 1.7 and this error now appears for me as well. according to the installlation instructions for tensorflow you need to install cocoapi. coco api can not run on windows, but someone made a port here To install you need microsoft visual c++ build tools. I was able to install after installing it through the visual studio 2017 community edition's installer program. after you have the build tool, open your command console as admin and do the following:

git clone https://github.com/philferriere/cocoapi.git
cd cocoapi/PythonAPI
python setup.py install

after that, eval should work.

this was relevant to me as well, but I only needed to install the build tools, not go through all of this

ViousGod commented 6 years ago

why i run "python setup.py install" in cmd, it shows TypeError: unorderable types: NoneType() >= str()

keerthana151094 commented 6 years ago

TypeError: '>=' not supported between instances of 'NoneType' and 'str' Has anyone solved it?

biendltb commented 5 years ago

First, make sure you already installed the COCO API properly.

If you look inside the model/research/ folder, you will see the pycocotools folder. Try to rename it to any other name. The reason of this problem is that the code imported the pycocotools from that folder, not from the installed folder that you just installed the COCO API.

mihuzz commented 5 years ago

Hi, I have Error when run setup.py install. May be some one help me?

\models\research\cocoapi\PythonAPI>python setup.py install Compiling pycocotools/_mask.pyx because it changed. [1/1] Cythonizing pycocotools/_mask.pyx D:\Anaconda3\envs\sdk\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: D:\Lesson8\models\research\cocoapi\PythonAPI\pycocotools\_mask.pyx tree = Parsing.p_module(s, pxd, full_module_name) running install running build running build_py creating build creating build\lib.win-amd64-3.6 creating build\lib.win-amd64-3.6\pycocotools copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools running build_ext building 'pycocotools._mask' extension creating build\temp.win-amd64-3.6 creating build\temp.win-amd64-3.6\Release creating build\temp.win-amd64-3.6\Release\pycocotools creating build\temp.win-amd64-3.6\common C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\Anaconda3\envs\sdk\lib\site-packages\numpy\core\include -I../common -ID:\Anaconda3\envs\sdk\include -ID:\Anaconda3\envs\sdk\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" /Tcpycocotools/_mask.c /Fobuild\temp.win-amd64-3.6\Release\pycocotools/_mask.obj _mask.c d:\anaconda3\envs\sdk\include\pyconfig.h(59): fatal error C1083: Не удается открыть файл включение: io.h: No such file or directory, error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

amit-code commented 5 years ago

You can replace extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'] with extra_compile_args={'gcc': ['/Qstd=c99']} in ./libs/datasets/pycocotools/setup.py. maybe help

kritoZhang commented 5 years ago

First, make sure you already installed the COCO API properly.

If you look inside the model/research/ folder, you will see the pycocotools folder. Try to rename it to any other name. The reason of this problem is that the code imported the pycocotools from that folder, not from the installed folder that you just installed the COCO API.

totally correct!

durgauestc commented 4 years ago

ModuleNotFoundError: No module named 'pycocotools' how to solve this in mmdetection