Following the TF tutorial on pet object detection :

Ran locally :

The training seems to work well.

Trying to launch the evaluation process :

From the tensorflow/models/research/ directory

python object_detection/ \--logtostderr \--pipeline_config_path=${PATH_TO_YOUR_PIPELINE_CONFIG} \--checkpoint_dir=${PATH_TO_TRAIN_DIR} \--eval_dir=${PATH_TO_EVAL_DIR}

I got the following error :

from pycocotools import coco \ModuleNotFoundError: No module named 'pycocotools'

Had a look on coco API but I don't see any clear way to install it on Windows.

Any advice on how to get the evaluation running the simpliest way ?

More details about the error message :

Traceback (most recent call last): File "object_detection/", line 50, in <module>from object_detection import evaluatorFile "D:\models\research\object_detection\", line 27, in <module>from object_detection.metrics import coco_evaluationFile "D:\models\research\object_detection\metrics\", line 20, in <module>from object_detection.metrics import coco_toolsFile "D:\models\research\object_detection\metrics\", line 47, in <module>from pycocotools import coco ModuleNotFoundError: No module named 'pycocotools'
share|improve this question
  • Did you try pip install git+^&subdirectory=PythonAPI (from– Akshay AgrawalFeb 12 at 18:17
  • Nope, will try ^^– Frédéric CoubardFeb 12 at 20:01
  • Some progress... Got an error about the & character : Le caractère perluète n’est pas autorisé. L’opérateur & est réservé à une utilisation future. Placez un caractère perluète entre guillemets doubles ("&") pour que ce symbole soit considéré comme une chaîne. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : AmpersandNotAllowed So I added quote... Cloning working but stopped because Microsoft Visual C++ 14.0 required. Will see If I can add it.– Frédéric CoubardFeb 13 at 7:23

Could you post the full stack trace so we can see where pycocotools is being imported from? We're adding COCO support to the Tensorflow Object-Detection API (with a few other goodies), and will update the installation instructions soon.

share|improve this answer
  • Yes I will. What do you mean by full stack trace ? The result after or after pip install git+... ?– Frédéric CoubardFeb 14 at 21:02
  • For the step that gives the following error: from pycocotools import coco \ ModuleNotFoundError: No module named 'pycocotools' Could you post all of the details?– Derek ChowFeb 15 at 18:42
  • Just added more details with the full error message. Is it what you need to identify where pycocotools is being imported from ? Many thanks for your support.*– Frédéric CoubardFeb 16 at 7:16
  • Download the cocoapi and run the python installation steps. ``` # From PythonAPI make sudo make install ```– Derek ChowFeb 16 at 19:55
  • Does downloading the cocoapi and running the installation steps make sense if you are running in the Google ML cloud? Does cocoapi need to be included in the gcloud ml-engine jobs submit training command here?…– hayduke2 days ago

Full stack I am getting is:

Traceback (most recent call last): File "/usr/lib/python2.7/", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/", line 72, in _run_code exec code in run_globals File "/root/.local/lib/python2.7/site-packages/object_detection/", line 50, in from object_detection import evaluator File "/root/.local/lib/python2.7/site-packages/object_detection/", line 27, in from object_detection.metrics import coco_evaluation File "/root/.local/lib/python2.7/site-packages/object_detection/metrics/", line 20, in from object_detection.metrics import coco_tools File "/root/.local/lib/python2.7/site-packages/object_detection/metrics/", line 47, in from pycocotools import coco ImportError: No module named pycocotools

This is from commit 20a4313d4494a022e65176ec10da3e91bcacc731 of tensorflow/models.

share|improve this answer

    Your Answer


    By posting your answer, you agree to the privacy policy and terms of service.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.