Understood itens 2 and 3.
I am stucked on item 1, that is, on pip3 install -r requirement_export.txt
. I tries to install onnx-graphsurgeon, but it fails with an error associated to ‘transform’ not being a member of ‘std’ from c++ compiler. How to correctly install those requirements?
ubuntu@ubuntu:~/edge/yolo_install/yolov5$ sudo pip3 install onnx-graphsurgeon
[sudo] password for ubuntu:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting onnx-graphsurgeon
Downloading https://developer.download.nvidia.com/compute/redist/onnx-graphsurgeon/onnx_graphsurgeon-0.3.27-py2.py3-none-any.whl (42 kB)
|████████████████████████████████| 42 kB 6.8 MB/s
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from onnx-graphsurgeon) (1.19.5)
Collecting onnx
Downloading onnx-1.14.0.tar.gz (11.3 MB)
|████████████████████████████████| 11.3 MB 3.9 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting protobuf>=3.20.2
Downloading protobuf-4.21.0-py3-none-any.whl (291 kB)
|████████████████████████████████| 291 kB 7.9 MB/s
Requirement already satisfied: typing-extensions>=3.6.2.1 in /home/ubuntu/.local/lib/python3.6/site-packages (from onnx->onnx-graphsurgeon) (4.1.1)
WARNING: The candidate selected for download or install is a yanked version: 'protobuf' candidate (version 4.21.0 at https://files.pythonhosted.org/packages/27/82/986065ef305c0989c99d8ef3f29e58a03fac6e64bb2c36ffe64500cc6955/protobuf-4.21.0-py3-none-any.whl#sha256=4e78116673ba04e01e563f6a9cca2c72db0be8a3e1629094816357e81cc39d36 (from https://pypi.org/simple/protobuf/))
Reason for being yanked: Required python version not configured correctly (https://github.com/protocolbuffers/protobuf/issues/10076)
Building wheels for collected packages: onnx
Building wheel for onnx (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/ubuntu/.local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp41d6h93y
cwd: /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687
Complete output (206 lines):
fatal: not a git repository (or any of the parent directories): .git
running bdist_wheel
running build
running build_py
running create_version
running cmake_build
Using cmake args: ['/usr/local/bin/cmake', '-DPYTHON_INCLUDE_DIR=/usr/include/python3.6m', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cpython-36m-aarch64-linux-gnu.so', '-DCMAKE_BUILD_TYPE=Release', '-DONNX_ML=1', '/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687']
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.9")
-- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.6m.so (found version "3.6.9")
-- Found Protobuf: /usr/lib/aarch64-linux-gnu/libprotobuf.a;-lpthread (found version "3.0.0")
Generated: /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-ml.proto
Generated: /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
Generated: /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-data.proto
-- Could NOT find pybind11 (missing: pybind11_DIR)
-- pybind11 v2.10.3
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.9", minimum required is "3.6")
-- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.6m.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
--
-- ******** Summary ********
-- CMake version : 3.26.4
-- CMake command : /usr/local/lib/python3.6/dist-packages/cmake/data/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 7.5.0
-- CXX flags : -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions : __STDC_FORMAT_MACROS
-- CMAKE_PREFIX_PATH :
-- CMAKE_INSTALL_PREFIX : /usr/local
-- CMAKE_MODULE_PATH :
--
-- ONNX version : 1.14.0
-- ONNX NAMESPACE : onnx
-- ONNX_USE_LITE_PROTO : OFF
-- USE_PROTOBUF_SHARED_LIBS : OFF
-- Protobuf_USE_STATIC_LIBS : ON
-- ONNX_DISABLE_EXCEPTIONS : OFF
-- ONNX_WERROR : OFF
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
--
-- Protobuf compiler : /usr/bin/protoc
-- Protobuf includes : /usr/include
-- Protobuf libraries : /usr/lib/aarch64-linux-gnu/libprotobuf.a;-lpthread
-- BUILD_ONNX_PYTHON : ON
-- Python version :
-- Python executable : /usr/bin/python3
-- Python includes : /usr/include/python3.6m
-- Configuring done (1.9s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build
[ 1%] Running gen_proto.py on onnx/onnx.in.proto
Processing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/onnx.in.proto
Writing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-ml.proto
Writing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-ml.proto3
generating /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx_pb.py
[ 2%] Running C++ protocol buffer compiler on /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-ml.proto
Failed to generate mypy stubs: No module named 'google'
[ 2%] Built target gen_onnx_proto
[ 4%] Running gen_proto.py on onnx/onnx-data.in.proto
[ 5%] Running gen_proto.py on onnx/onnx-operators.in.proto
Processing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/onnx-operators.in.proto
Writing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
Writing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-operators-ml.proto3
generating /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx_operators_pb.py
Processing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/onnx-data.in.proto
Writing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-data.proto
Writing /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-data.proto3
generating /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx_data_pb.py
[ 8%] Running C++ protocol buffer compiler on /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-data.proto
[ 8%] Running C++ protocol buffer compiler on /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/.setuptools-cmake-build/onnx/onnx-operators-ml.proto
Failed to generate mypy stubs: No module named 'google'
Failed to generate mypy stubs: No module named 'google'
[ 8%] Built target gen_onnx_operators_proto
[ 8%] Built target gen_onnx_data_proto
[ 10%] Building CXX object CMakeFiles/onnx_proto.dir/onnx/onnx-ml.pb.cc.o
[ 11%] Building CXX object CMakeFiles/onnx_proto.dir/onnx/onnx-operators-ml.pb.cc.o
[ 13%] Building CXX object CMakeFiles/onnx_proto.dir/onnx/onnx-data.pb.cc.o
[ 14%] Linking CXX static library libonnx_proto.a
[ 23%] Built target onnx_proto
[ 26%] Building CXX object CMakeFiles/onnx.dir/onnx/common/assertions.cc.o
[ 26%] Building CXX object CMakeFiles/onnx.dir/onnx/checker.cc.o
[ 27%] Building CXX object CMakeFiles/onnx.dir/onnx/common/interned_strings.cc.o
[ 29%] Building CXX object CMakeFiles/onnx.dir/onnx/common/path.cc.o
[ 30%] Building CXX object CMakeFiles/onnx.dir/onnx/defs/attr_proto_util.cc.o
[ 32%] Building CXX object CMakeFiles/onnx.dir/onnx/common/status.cc.o
[ 35%] Building CXX object CMakeFiles/onnx.dir/onnx/common/model_helpers.cc.o
[ 35%] Building CXX object CMakeFiles/onnx.dir/onnx/common/ir_pb_converter.cc.o
[ 36%] Building CXX object CMakeFiles/onnx.dir/onnx/defs/controlflow/defs.cc.o
[ 38%] Building CXX object CMakeFiles/onnx.dir/onnx/defs/controlflow/old.cc.o
[ 39%] Building CXX object CMakeFiles/onnx.dir/onnx/defs/controlflow/utils.cc.o
In file included from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/schema.h:25:0,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/function.h:16,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/checker.h:10,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/checker.cc:5:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h: In function ‘void onnx::adjustNegativeAxes(Axes&, int)’:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h:828:8: error: ‘transform’ is not a member of ‘std’
std::transform(
^~~~~~~~~
In file included from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/schema.h:25:0,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/function.h:16,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/checker.h:10,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/common/model_helpers.cc:6:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h: In function ‘void onnx::adjustNegativeAxes(Axes&, int)’:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h:828:8: error: ‘transform’ is not a member of ‘std’
std::transform(
^~~~~~~~~
[ 41%] Building CXX object CMakeFiles/onnx.dir/onnx/defs/data_type_utils.cc.o
In file included from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/schema.h:25:0,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/controlflow/utils.h:7,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/controlflow/defs.cc:8:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h: In function ‘void onnx::adjustNegativeAxes(Axes&, int)’:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h:828:8: error: ‘transform’ is not a member of ‘std’
std::transform(
^~~~~~~~~
In file included from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/schema.h:25:0,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/controlflow/utils.h:7,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/controlflow/old.cc:7:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h: In function ‘void onnx::adjustNegativeAxes(Axes&, int)’:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h:828:8: error: ‘transform’ is not a member of ‘std’
std::transform(
^~~~~~~~~
In file included from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/schema.h:25:0,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/math/utils.h:7,
from /tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/controlflow/utils.cc:5:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h: In function ‘void onnx::adjustNegativeAxes(Axes&, int)’:
/tmp/pip-install-_f9bz3go/onnx_220296baf1f04f36a37198b3e706c687/onnx/defs/shape_inference.h:828:8: error: ‘transform’ is not a member of ‘std’
std::transform(
^~~~~~~~~
CMakeFiles/onnx.dir/build.make:131: recipe for target 'CMakeFiles/onnx.dir/onnx/common/model_helpers.cc.o' failed
make[2]: *** [CMakeFiles/onnx.dir/onnx/common/model_helpers.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/onnx.dir/build.make:187: recipe for target 'CMakeFiles/onnx.dir/onnx/defs/controlflow/defs.cc.o' failed
make[2]: *** [CMakeFiles/onnx.dir/onnx/defs/controlflow/defs.cc.o] Error 1
CMakeFiles/onnx.dir/build.make:201: recipe for target 'CMakeFiles/onnx.dir/onnx/defs/controlflow/old.cc.o' failed
make[2]: *** [CMakeFiles/onnx.dir/onnx/defs/controlflow/old.cc.o] Error 1
CMakeFiles/onnx.dir/build.make:215: recipe for target 'CMakeFiles/onnx.dir/onnx/defs/controlflow/utils.cc.o' failed
make[2]: *** [CMakeFiles/onnx.dir/onnx/defs/controlflow/utils.cc.o] Error 1
CMakeFiles/onnx.dir/build.make:75: recipe for target 'CMakeFiles/onnx.dir/onnx/checker.cc.o' failed
make[2]: *** [CMakeFiles/onnx.dir/onnx/checker.cc.o] Error 1
CMakeFiles/Makefile2:212: recipe for target 'CMakeFiles/onnx.dir/all' failed
make[1]: *** [CMakeFiles/onnx.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/ubuntu/.local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/ubuntu/.local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 262, in build_wheel
metadata_directory)
File "/tmp/pip-build-env-yed7_gva/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 231, in build_wheel
wheel_directory, config_settings)
File "/tmp/pip-build-env-yed7_gva/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-yed7_gva/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 268, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-yed7_gva/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 365, in <module>
"backend-test-tools = onnx.backend.test.cmd_tools:main",
File "/tmp/pip-build-env-yed7_gva/overlay/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-yed7_gva/overlay/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 236, in run
self.run_command("cmake_build")
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 230, in run
subprocess.check_call(build_args)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '--build', '.', '--', '-j', '8']' returned non-zero exit status 2.
----------------------------------------
ERROR: Failed building wheel for onnx
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects