I've got import errors when trying to reuse the detectron
Expected Results:
Successful inference
Actual Results
Traceback (most recent call last):
File "infer_simple.py", line 44, in <module>
import detectron.core.test_engine as infer_engine
File ".../detectron/core/test_engine.py", line 35, in <module>
from detectron.core.rpn_generator import generate_rpn_on_dataset
File ".../detectron/core/rpn_generator.py", line 42, in <module>
from detectron.datasets import task_evaluation
File ".../detectron/datasets/task_evaluation.py", line 47, in <module>
import detectron.datasets.json_dataset_evaluator as json_dataset_evaluator
File ".../detectron/datasets/json_dataset_evaluator.py", line 34, in <module>
import detectron.utils.boxes as box_utils
File ".../detectron/utils/boxes.py", line 52, in <module>
import detectron.utils.cython_nms as cython_nms
ImportError: .../detectron/utils/cython_nms.so: undefined symbol: PyFPE_jbuf
Detailed steps to reproduce
<code>conda install pytorch-nightly -c pytorch</code><br>
DETECTRON=/path/to/clone/detectron<br>
<code>git clone https://github.com/facebookresearch/detectron $DETECTRON</code><br>
<code>pip install -r $DETECTRON/requirements.txt</code><br>
<code>cd $DETECTRON && make <code>
<code>python $DETECTRON/detectron/tools/infer_simple.py</code>
System information
Operating system: Ubuntu 16.04
Compiler version: Cmake 3.12.0
CUDA version: 9.2
cuDNN version: 9.0
NVIDIA driver version: 396.37
GPU model: Nvidia K80
PYTHONPATH: empty
python --version
> Python 2.7.15 :: Anaconda, Inc.
Anything else that seems relevant:
Caffe2
is working just fine, test_spatial_narrow_as_op.py
returns 'OK'
From what I found on the web, the problem is that I have different versions of cython, numpy or opencv on my different versions of python
and anaconda
. But if I remove numpy
or opencv
from anaconda
, then caffe
doesn't work anymore, and if I remove cython
from my original python
packages, then the make command in cd detectron && make fails.
I feel like if I could tell make to use Cython from anaconda and not from the default python it should work.