尝试重用检测器时出现导入错误
预期成绩:
成功推理
实际结果
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
重现的详细步骤
<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>
系统信息
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.
其他任何似乎相关的内容:
Caffe2
工作正常,test_spatial_narrow_as_op.py
返回“OK”
从我在网上找到的内容来看,问题是我在不同版本的python
和anaconda
. 但是,如果我从中删除numpy
or ,则不再起作用,并且如果我从原始软件包中删除,则 cd detectron && make 中的 make 命令将失败。opencv
anaconda
caffe
cython
python
我觉得如果我可以告诉 make 使用 anaconda 中的 Cython 而不是默认 python 它应该可以工作。