onnx-tensorrt icon indicating copy to clipboard operation
onnx-tensorrt copied to clipboard

Getting error in make

Open danishansari opened this issue 4 years ago • 3 comments

In file included from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ModelImporter.cpp:8:0: /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/onnx_utils.hpp: In function ‘bool ParseFromFile_WAR(google::protobuf::Message*, const char*)’: /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/onnx_utils.hpp:129:104: error: no matching function for call to ‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int, int)’ coded_input.SetTotalBytesLimit(std::numeric_limits::max(), std::numeric_limits::max() / 4); ^ In file included from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/build/third_party/onnx/onnx/onnx_onnx2trt_onnx-ml.pb.h:23:0, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/build/third_party/onnx/onnx/onnx-ml.pb.h:2, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/third_party/onnx/onnx/onnx_pb.h:50, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ShapedWeights.hpp:8, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/onnx2trt.hpp:8, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ImporterContext.hpp:7, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ModelImporter.hpp:7, from /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ModelImporter.cpp:5: /usr/local/include/google/protobuf/io/coded_stream.h:402:8: note: candidate: void google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int) void SetTotalBytesLimit(int total_bytes_limit); ^~~~~~~~~~~~~~~~~~ /usr/local/include/google/protobuf/io/coded_stream.h:402:8: note: candidate expects 1 argument, 2 provided /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ModelImporter.cpp: In function ‘onnx2trt::Status onnx2trt::deserialize_onnx_model(const void*, size_t, bool, onnx2trt_onnx::ModelProto*)’: /home/danish/Downloads/danish/code/TF2/ModelConversion/onnx-tensorrt/ModelImporter.cpp:288:108: error: no matching function for call to ‘google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int, int)’ coded_input.SetTotalBytesLimit(std::numeric_limits::max(), std::numeric_limits::max() / 4); ^

I installed protobuf as below: sudo apt-get install autoconf automake libtool curl make g++ unzip -y git clone https://github.com/google/protobuf.git cd protobuf git submodule update --init --recursive ./autogen.sh ./configure make -j8 make check sudo make install sudo ldconfig

Mahcine specs: Ubuntu: 18.04 TensorRT: 8.0.1.6

danishansari avatar Aug 28 '21 07:08 danishansari

What version of protobuf are you using? You may have to use a lower version.

kevinch-nv avatar Sep 13 '21 19:09 kevinch-nv

I'm having the same issue.

machine specs (JETSON AGX XAVIER): Ubuntu: 18.04 TensorRT: 8.0.1 Protobuf: 3.16.0

nrpr161293 avatar Sep 17 '21 13:09 nrpr161293

They changed this function in this version: https://github.com/protocolbuffers/protobuf/blob/92a7e778e7394386f413cec28d67a07630f784b1/src/google/protobuf/io/coded_stream.cc

Maybe you can change it like this: https://github.com/protocolbuffers/protobuf/blob/09354db1434859a31a3c81abebcc4018d42f2715/src/google/protobuf/io/coded_stream.cc

But in the old function "warning_threshold" is useless. I deleted all " std::numeric_limits::max() / 4"

qmcreeper avatar Sep 23 '21 15:09 qmcreeper