github地址:https://github.com/ONNX
1.安装
从源文件进行安装
sudo apt-get install protobuf-compiler libprotoc-dev cmake
git clone https://github.com/onnx/onnx.git
cd onnx
git submodule update --init --recursive
python setup.py install
这时候有可能会报错
Traceback (most recent call last):
File "setup.py", line 8, in <module>
import setuptools
ImportError: No module named setuptools
通过安装setuptools解决该问题
Python 2.x: sudo apt-get install python-setuptools
Python 3.x: sudo apt-get install python3-setuptools
2.验证
安装完成后通过python -c "import onnx"验证安装成功
3.测试
ONNX使用pytest作为测试驱动器,为了运行测试首先安装pytest:
pip install pytest nbval
运行pytest