optimizer
optimizer copied to clipboard
Need more explicit instruction on installing the Protobuf and ONNX optimizer.
Hi,
I tried installinig the Protobuf via both building from source and apt. When I tried to build ONNX optimizer from source, I got problems related to Protobuf. How do I specify Protobuf for installing ONNX optimizer? Thank you.
root@3235dac98ab6:/mnt# pip install -e .
Obtaining file:///mnt
Requirement already satisfied: onnx in /tmp/onnx (from onnxoptimizer==0.2.6) (1.9.0)
Requirement already satisfied: protobuf in /usr/local/lib/python3.8/dist-packages (from onnx->onnxoptimizer==0.2.6) (3.17.3)
Requirement already satisfied: numpy>=1.16.6 in /usr/local/lib/python3.8/dist-packages (from onnx->onnxoptimizer==0.2.6) (1.21.0)
Requirement already satisfied: six in /usr/local/lib/python3.8/dist-packages (from onnx->onnxoptimizer==0.2.6) (1.16.0)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.8/dist-packages (from onnx->onnxoptimizer==0.2.6) (3.10.0.0)
Installing collected packages: onnxoptimizer
Running setup.py develop for onnxoptimizer
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/mnt/setup.py'"'"'; __file__='"'"'/mnt/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'"'"'))' develop --no-deps
cwd: /mnt/
Complete output (105 lines):
running develop
running build_py
running create_version
running cmake_build
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:469 (file):
file STRINGS file "/opt/conda/include/google/protobuf/stubs/common.h"
cannot be read.
Call Stack (most recent call first):
third_party/onnx/CMakeLists.txt:172 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:475 (math):
math cannot parse the expression: " / 1000000": syntax error, unexpected
exp_DIVIDE (2).
Call Stack (most recent call first):
third_party/onnx/CMakeLists.txt:172 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:476 (math):
math cannot parse the expression: " / 1000 % 1000": syntax error,
unexpected exp_DIVIDE (2).
Call Stack (most recent call first):
third_party/onnx/CMakeLists.txt:172 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:477 (math):
math cannot parse the expression: " % 1000": syntax error, unexpected
exp_MOD (2).
Call Stack (most recent call first):
third_party/onnx/CMakeLists.txt:172 (find_package)