Onnx-tensorrt: error: 'numeric_limits' is not a member of 'std'

Created on 5 Jun 2020  路  2Comments  路  Source: onnx/onnx-tensorrt

# 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
bug triaged

Most helpful comment

open onnx_utils.hpp and add heads:
#include <stdexcept>
#include <limits>

All 2 comments

open onnx_utils.hpp and add heads:
#include <stdexcept>
#include <limits>

Oops. I'll make a PR addressing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhanghongruiupup picture zhanghongruiupup  路  8Comments

wangzilu picture wangzilu  路  8Comments

omeralierdemir picture omeralierdemir  路  6Comments

basaltzhang picture basaltzhang  路  5Comments

xiaoxiaotao picture xiaoxiaotao  路  4Comments