OS:Ubuntu 18.04 LTS
Python Environment = 3.6.8 (System default version)
I followed this link to install cocoapi.
However, it shows the error below:
ubuntu:~/cocoapi-master/PythonAPI$ make
python setup.py build_ext --inplace
Traceback (most recent call last):
File "setup.py", line 2, in <module>
import numpy as np
ImportError: No module named numpy
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 1
I have already installed the needed dependencies mentioned in objection_detection/g3doc/installation.md.
I have also installed Cython and Numpy.
Could somebody help me fix this issue? Thanks in advance.
I run this code
python3 setup.py build_ext --inplace
It doesn't show error.
However, when I tried to run a Tensorflow/models/research/object_detection/model_main.py, it shows error again.
Command line:
ubuntu:~/PycharmProjects/PedestrianDetection$ python object_detection/model_main.py --pipeline_config_path=pretrained/pipeline.config --model_dir=train --num_train_steps=1000 --sample_1_of_n_eval_examples=1 --alsologtostderr
Error:
Traceback (most recent call last):
File "object_detection/model_main.py", line 26, in <module>
from object_detection import model_lib
File "/home/yantong/PycharmProjects/PedestrianDetection/object_detection/model_lib.py", line 28, in <module>
from object_detection import eval_util
File "/home/yantong/PycharmProjects/PedestrianDetection/object_detection/eval_util.py", line 28, in <module>
from object_detection.metrics import coco_evaluation
File "/home/yantong/PycharmProjects/PedestrianDetection/object_detection/metrics/coco_evaluation.py", line 20, in <module>
from object_detection.metrics import coco_tools
File "/home/yantong/PycharmProjects/PedestrianDetection/object_detection/metrics/coco_tools.py", line 47, in <module>
from pycocotools import coco
File "/home/yantong/PycharmProjects/PedestrianDetection/pycocotools/coco.py", line 55, in <module>
from . import mask as maskUtils
File "/home/yantong/PycharmProjects/PedestrianDetection/pycocotools/mask.py", line 3, in <module>
import pycocotools._mask as _mask
ModuleNotFoundError: No module named 'pycocotools._mask'
Under ~/PycharmProjects/PedestrianDetection/pycocotools, I have
cocoeval.py coco.py __init__.py mask.py __pycache__
cocoeval.py.bak coco.py.bak _mask.c _mask.pyx
I'm wondering why it shows No module named 'pycocotools._mask' as well.