onnx-tensorrt
onnx-tensorrt copied to clipboard
error: 'numeric_limits' is not a member of 'std'
# gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~16.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Got following error:
In file included from /opt/onnx-tensorrt/main.cpp:24:0:
/opt/onnx-tensorrt/onnx_utils.hpp: In function 'bool ParseFromFile_WAR(google::protobuf::Message*, const char*)':
/opt/onnx-tensorrt/onnx_utils.hpp:147:41: error: 'numeric_limits' is not a member of 'std'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~~~~~~~~~~~~
/opt/onnx-tensorrt/onnx_utils.hpp:147:56: error: expected primary-expression before 'int'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~
/opt/onnx-tensorrt/onnx_utils.hpp:147:74: error: 'numeric_limits' is not a member of 'std'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~~~~~~~~~~~~
/opt/onnx-tensorrt/onnx_utils.hpp:147:89: error: expected primary-expression before 'int'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~
In file included from /opt/onnx-tensorrt/getSupportedAPITest.cpp:29:0:
/opt/onnx-tensorrt/onnx_utils.hpp: In function 'bool ParseFromFile_WAR(google::protobuf::Message*, const char*)':
/opt/onnx-tensorrt/onnx_utils.hpp:147:41: error: 'numeric_limits' is not a member of 'std'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~~~~~~~~~~~~
/opt/onnx-tensorrt/onnx_utils.hpp:147:56: error: expected primary-expression before 'int'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~
/opt/onnx-tensorrt/onnx_utils.hpp:147:74: error: 'numeric_limits' is not a member of 'std'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~~~~~~~~~~~~
/opt/onnx-tensorrt/onnx_utils.hpp:147:89: error: expected primary-expression before 'int'
coded_input.SetTotalBytesLimit(std::numeric_limits<int>::max(), std::numeric_limits<int>::max() / 4);
^~~
CMakeFiles/getSupportedAPITest.dir/build.make:82: recipe for target 'CMakeFiles/getSupportedAPITest.dir/getSupportedAPITest.cpp.o' failed
open onnx_utils.hpp and add heads:
#include <stdexcept>
#include <limits>
Oops. I'll make a PR addressing this.
#include <limits> // std::numeric_limits
@Tian14267,good job,thanks