1

System info: Ubuntu 16.04

Python 3.6.5 in anaconda3/envs/testcaffe/bin/python3

Anaconda3 4.5.2

CPU only

I installed Caffe2 by conda install -c caffe2 caffe2 for python to find onnx i set the PYTHONPATH to /home/username/WorkStuff/anaconda3/envs/testcaffe/lib/python3.6/site-packages/caffe2/python

importing onnx import onnx in python works fine, but when i tried to run converter script provided in tutorial i get this:

File "converter.py", line 2, in <module>
import caffe2.python.onnx.frontend
File "/home/username/WorkStuff/anaconda3/envs/testcaffe/lib/python3.6/site- 
packages/caffe2/python/onnx/frontend.py", line 22, in <module>
from onnx import (defs, checker, helper, numpy_helper, mapping,
File "/home/username/WorkStuff/anaconda3/envs/testcaffe/lib/python3.6/site- 
packages/caffe2/python/onnx/helper.py", line 9, in <module>
from onnx.backend.base import namedtupledict
File "/home/username/WorkStuff/anaconda3/envs/testcaffe/lib/python3.6/site- 
packages/caffe2/python/onnx/backend.py", line 33, in <module>
from onnx import checker, GraphProto, TensorProto, AttributeProto, 
ModelProto
ImportError: cannot import name 'checker'

checker.h is located in /home/username/WorkStuff/anaconda3/envs/testcaffe/include/onnx although there are no ...Proto files in my testcaffe directory

if i just run Python and write import onnx.checker it returns ModuleNotFoundError: No module named 'onnx.checker'

seems like onnx cant import any of its modules

Is there anything i simply miss or don't understand? Thank you for your help

4

1 回答 1

0

显然,较新版本的 ONNX 没有这些文件。

我测试了 ONNX v1.0.0,一切都在那里。请使用以下方式安装它:conda install -c willyd onnx

这适用于 linux x64,但我不确定如何在其他系统上修复。

于 2018-05-16T14:28:50.947 回答