0

I'm trying to execute the infer.py file from the Detectron project, but when I run it, I get the following error :

.../miniconda3/envs/testcaffe2/bin/python
.../PycharmProjects/Detectron-master/tools/infer.py --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml --output-dir /tmp/detectron-visualizations --image-ext jpg --wts https://s3-us-west-2.amazonaws.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl demo

Traceback (most recent call last):
File ".../PycharmProjects/Detectron-master/tools/infer.py", line 44, in import core.rpn_generator as rpn_engine
File ".../PycharmProjects/Detectron-master/lib/core/rpn_generator.py", line 42, in from datasets import task_evaluation
File ".../PycharmProjects/Detectron-master/lib/datasets/task_evaluation.py", line 45, in import datasets.cityscapes_json_dataset_evaluator as cs_json_dataset_evaluator
File ".../PycharmProjects/Detectron-master/lib/datasets/cityscapes_json_dataset_evaluator.py", line 28, in import pycocotools.mask as mask_util
File ".../PycharmProjects/Detectron-master/pycocotools/mask.py", line 3, in import pycocotools._mask as _mask ImportError: No module named _mask

It seems that it doesn't recognize the _mask.pyx file. I verified, in my miniconda3 python 2.7.4, that the virtual environment set for this project contains all the necessary libraries. You can see by yourself if there isn't anything missing :

CythonLibs

By trying to figure out the origin of the problem, I followed this tutorial, and it worked well. However, when I tried to execute this example alone it didn't work. For this example, my helloworld.pyx script is as follows :

cimport cython
cpdef hello_world():
    return 'Hello, World'
YellowishLight
  • 238
  • 3
  • 21

1 Answers1

0

The following command solved my problem:

export PYTHONPATH=/home/ubuntu/.local/lib/python2.7/site-packages:$PYTHONPATH
mining
  • 3,557
  • 5
  • 39
  • 66