Search code examples
deep-learningprotocol-bufferscaffe2onnx

Onnx 'helper' and 'checker' attribute are not defined


I have onnx 0.2.1 installed on my conda virtual environment

conda list | grep onnx

packages in environment at /Users/aanirud/anaconda2/envs/onnx:
onnx 0.2.1 py27_1 ezyang
onnx-caffe2 0.2.1 py27hbe716ef_1 ezyang
onnx-mxnet 0.4.1

But I am not able to use the onnx.checker or onnx.helper attributes. When I try to use them I get the following error -

import onnx
onnx.checker.check_model("toy_model.onnx")
Traceback (most recent call last):
File "", line 1, in 
AttributeError: 'module' object has no attribute 'checker'

Get the same error when I try to use onnx.helper. What am I doing wrong here?


Solution

  • The issue was the onnx version, there was a bug in the old version. Using onnx >= 1.0.0 works

    Running the following works - git clone --recursive https://github.com/onnx/onnx.git MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install