安装onnx-simplifier或onnx报错

安装 pip install -U onnx-simplifier --user报错,

 Building wheel for onnx (setup.py) ... error

  ERROR: Command errored out with exit status 1:

   command: 'D:\anaconda\envs\py36torchgpu\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\xx\\AppData\\Local\\Temp\\pip-install-yq5jjbxu\\onnx_698e2a14f57c4613aeb0f0e898bd538b\\setup.py'"'"'; __file__='"'"'C:\\Users\\xx\\AppData\\Local\\Temp\\pip-install-yq5jjbxu\\onnx_698e2a14f57c4613aeb0f0e898bd538b\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\xx\AppData\Local\Temp\pip-wheel-61wac6a0'

解决办法:安装的onnx版本不对,安装

pip install onnx==1.11.0

安装成功后,再安装pip install -U onnx-simplifier --user

这样就安装成功了。

你可能感兴趣的:(错误,python,开发语言)