openvino: [Bug] Unable to build openvino for ubuntu 18.04, throws no match for ‘operator[]’
- OpenVINO=> 2021.4.752
- Operating System / Platform => Linux Ubuntu 18.04
- Compiler => ❔
- Problem classification => ❔
Detailed description
Previously Openvino used to work with Ubuntu 18.04, but very recently, It has stopped working, I was trying to build openvino for our application but it started failing with some reason. These are the errors which we didn’t see earlier.
While performing make, initially it throwed error “Protobuf compiler not found”, so i went ahead and installed apt-get install protobuf-compiler
Then again it started error Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR), now this time i installed apt-get install -y libprotobuf-dev
And then now it is throwing error
[ 43%] Building CXX object CMakeFiles/onnx.dir/onnx/shape_inference/implementation.cc.o
/tmp/pip-install-178o727p/onnx_6c6138ba506e4fd0b670c5471525c410/onnx/defs/sequence/defs.cc: In function ‘bool onnx::BuildSequenceMapBodyFunc(const onnx::FunctionBodyBuildContext&, const onnx::OpSchema&, onnx::FunctionProto&)’:
/tmp/pip-install-178o727p/onnx_6c6138ba506e4fd0b670c5471525c410/onnx/defs/sequence/defs.cc:675:40: error: no match for ‘operator[]’ (operand types are ‘google::protobuf::RepeatedPtrField<onnx::ValueInfoProto>’ and ‘int’)
seq_at_node.add_output(g_inputs[inputIndex].name());
^
/tmp/pip-install-178o727p/onnx_6c6138ba506e4fd0b670c5471525c410/onnx/defs/sequence/defs.cc:683:37: error: no match for ‘operator[]’ (operand types are ‘google::protobuf::RepeatedPtrField<onnx::ValueInfoProto>’ and ‘int’)
identity.add_output(g_inputs[inputIndex].name());
^
/tmp/pip-install-178o727p/onnx_6c6138ba506e4fd0b670c5471525c410/onnx/defs/sequence/defs.cc:741:30: error: no match for ‘operator[]’ (operand types are ‘google::protobuf::RepeatedPtrField<onnx::ValueInfoProto>’ and ‘int’)
int64_t dtype = g_outputs[outputIndex].type().tensor_type().elem_type();
^
[ 45%] Building CXX object CMakeFiles/onnx.dir/onnx/version_converter/convert.cc.o
CMakeFiles/onnx.dir/build.make:830: recipe for target 'CMakeFiles/onnx.dir/onnx/defs/sequence/defs.cc.o' failed
Steps to reproduce
- git clone https://github.com/gramineproject/examples/tree/master/openvino
- cd examples/openvino
- wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2021.4.2/l_openvino_toolkit_dev_ubuntu18_p_2021.4.752.tgz tar xzf l_openvino_toolkit_dev_ubuntu18_p_2021.4.752.tgz
- source l_openvino_toolkit_dev_ubuntu18_p_2021.4.752/bin/setupvars.sh
- make
Issue submission checklist
- [ Y] I report the issue, it’s not a question
- [ Y] I checked the problem with documentation, FAQ, open issues, Stack Overflow, etc and have not found solution
- [Y ] There is reproducer code and related data files: images, videos, models, etc.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (1 by maintainers)
Thanks tomdol. Your comment led me to the solution.
I had to manually clone/build/install protobuf 3.12.4 (no need to try change to onnx 1.8.1.). Thus, instead of using the default libraries
sudo apt install -y libprotobuf-dev protobuf-compilerI used these commands (https://gist.github.com/diegopacheco/cd795d36e6ebcd2537cd18174865887b) to build protobuf at the 3.12.4 tag/version. Then the command:completed with result:
Successfully installed fastjsonschema-2.15.3 onnx-1.12.0. 👍Thanks for all the help.
I am able to build openvino now by restricting onnx==1.8.1 in ./deployment_tools/model_optimizer/requirements.txt.
If i try to install separately using apt, it ends up with pybind11 error, but this way it works.