onnx / onnx-tensorrt

ONNX-TensorRT: TensorRT backend for ONNX
Apache License 2.0
2.95k stars 545 forks source link

make error #922

Open mjc12326 opened 1 year ago

mjc12326 commented 1 year ago

/home/mjc/onnx-tensorrt/TensorOrWeights.hpp:115:38: error: ‘kUINT8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kUINT8: return "UINT8"; ^~ /home/mjc/onnx-tensorrt/TensorOrWeights.hpp:118:38: error: ‘kFP8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kFP8: return "FP8"; ^~~~ In file included from /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp:10:0, from /home/mjc/onnx-tensorrt/ImporterContext.hpp:8, from /home/mjc/onnx-tensorrt/ModelImporter.hpp:7, from /home/mjc/onnx-tensorrt/NvOnnxParser.cpp:6: /home/mjc/onnx-tensorrt/trt_utils.hpp: In function ‘int onnx2trt::getDtypeSize(nvinfer1::DataType)’: /home/mjc/onnx-tensorrt/trt_utils.hpp:24:30: error: ‘kUINT8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kUINT8: ^~ /home/mjc/onnx-tensorrt/trt_utils.hpp:26:30: error: ‘kFP8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kFP8: return 1; ^~~~ /home/mjc/onnx-tensorrt/trt_utils.hpp: In function ‘onnx2trt_onnx::TensorProto_DataType onnx2trt::trtDataTypeToONNX(nvinfer1::DataType)’: /home/mjc/onnx-tensorrt/trt_utils.hpp:159:30: error: ‘kUINT8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kUINT8: return ::ONNX_NAMESPACE::TensorProto::UINT8; ^~ /home/mjc/onnx-tensorrt/trt_utils.hpp:160:30: error: ‘kFP8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kFP8: break; ^~~~ In file included from /home/mjc/onnx-tensorrt/ImporterContext.hpp:8:0, from /home/mjc/onnx-tensorrt/ModelImporter.hpp:7, from /home/mjc/onnx-tensorrt/NvOnnxParser.cpp:6: /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp: In function ‘std::ostream& nvinfer1::operator<<(std::ostream&, const nvinfer1::DataType&)’: /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp:75:30: error: ‘kUINT8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kUINT8: return stream << "uint8"; ^~ /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp:78:30: error: ‘kFP8’ is not a member of ‘nvinfer1::DataType’ case nvinfer1::DataType::kFP8: return stream << "float8"; ^~~~ /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp: In function ‘nvinfer1::IConstantLayer onnx2trt::addConstantScalar(onnx2trt::IImporterContext, ScalarType, onnx2trt::ShapedWeights::DataType, nvinfer1::Dims)’: /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp:108:21: error: ‘class nvinfer1::INetworkDefinition’ has no member named ‘setWeightsName’; did you mean ‘setName’? ctx->network()->setWeightsName(scalarWeights, scalarWeights.getName()); ^~~~~~ setName /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp: In function ‘nvinfer1::IConstantLayer onnx2trt::addConstant(onnx2trt::IImporterContext, const std::vector&, onnx2trt::ShapedWeights::DataType, nvinfer1::Dims)’: /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp:122:21: error: ‘class nvinfer1::INetworkDefinition’ has no member named ‘setWeightsName’; did you mean ‘setName’? ctx->network()->setWeightsName(weights, weights.getName()); ^~~~~~ setName In file included from /home/mjc/onnx-tensorrt/ImporterContext.hpp:8:0, from /home/mjc/onnx-tensorrt/ModelImporter.hpp:7, from /home/mjc/onnx-tensorrt/NvOnnxParser.cpp:6: /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp: At global scope: /home/mjc/onnx-tensorrt/onnx2trt_utils.hpp:432:117: error: ‘nvinfer1::ScatterMode’ has not been declared E::NodeProto& node, std::vector& inputs, nvinfer1::ScatterMode mode, int32_t axis = 0); ^~~ In file included from /home/mjc/onnx-tensorrt/ModelImporter.hpp:7:0, from /home/mjc/onnx-tensorrt/NvOnnxParser.cpp:6: /home/mjc/onnx-tensorrt/ImporterContext.hpp: In constructor ‘onnx2trt::ErrorRecorderWrapper::ErrorRecorderWrapper(nvinfer1::INetworkDefinition, nvinfer1::ILogger)’: /home/mjc/onnx-tensorrt/ImporterContext.hpp:28:44: error: ‘class nvinfer1::INetworkDefinition’ has no member named ‘getErrorRecorder’ mUserErrorRecorder = mNetwork->getErrorRecorder(); ^~~~ /home/mjc/onnx-tensorrt/ImporterContext.hpp:36:27: error: ‘class nvinfer1::INetworkDefinition’ has no member named ‘setErrorRecorder’ mNetwork->setErrorRecorder(mOnnxErrorRecorder); ^~~~ /home/mjc/onnx-tensorrt/ImporterContext.hpp: In destructor ‘onnx2trt::ErrorRecorderWrapper::~ErrorRecorderWrapper()’: /home/mjc/onnx-tensorrt/ImporterContext.hpp:47:27: error: ‘class nvinfer1::INetworkDefinition’ has no member named ‘setErrorRecorder’ mNetwork->setErrorRecorder(mUserErrorRecorder); ^~~~ CMakeFiles/nvonnxparser.dir/build.make:75: recipe for target 'CMakeFiles/nvonnxparser.dir/NvOnnxParser.cpp.o' failed make[2]: [CMakeFiles/nvonnxparser.dir/NvOnnxParser.cpp.o] Error 1 CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/nvonnxparser.dir/all' failed make[1]: [CMakeFiles/nvonnxparser.dir/all] Error 2 Makefile:155: recipe for target 'all' failed make: *** [all] Error 2

manavjeetsingh commented 1 year ago

Facing the same error on Orin nx. Did you solve it?

wanglong001 commented 12 months ago

+1

root@7d2c09275c09:/opt/onnx-tensorrt/build# make
[  4%] Built target gen_onnx_proto
[  9%] Built target gen_onnx_data_proto
[ 14%] Built target gen_onnx_operators_proto
[ 38%] Built target onnx_proto
[ 40%] Building CXX object CMakeFiles/nvonnxparser_static.dir/NvOnnxParser.cpp.o
In file included from /opt/onnx-tensorrt/onnx2trt.hpp:10,
                 from /opt/onnx-tensorrt/ImporterContext.hpp:7,
                 from /opt/onnx-tensorrt/ModelImporter.hpp:7,
                 from /opt/onnx-tensorrt/NvOnnxParser.cpp:6:
/opt/onnx-tensorrt/TensorOrWeights.hpp: In member function 'std::string onnx2trt::TensorOrWeights::getType() const':
/opt/onnx-tensorrt/TensorOrWeights.hpp:118:38: error: 'kFP8' is not a member of 'nvinfer1::DataType'
  118 |             case nvinfer1::DataType::kFP8: return "FP8";
      |                                      ^~~~
In file included from /opt/onnx-tensorrt/onnx2trt_utils.hpp:10,
                 from /opt/onnx-tensorrt/ImporterContext.hpp:8,
                 from /opt/onnx-tensorrt/ModelImporter.hpp:7,
                 from /opt/onnx-tensorrt/NvOnnxParser.cpp:6:
/opt/onnx-tensorrt/trt_utils.hpp: In function 'int onnx2trt::getDtypeSize(nvinfer1::DataType)':
/opt/onnx-tensorrt/trt_utils.hpp:26:30: error: 'kFP8' is not a member of 'nvinfer1::DataType'
   26 |     case nvinfer1::DataType::kFP8: return 1;
      |                              ^~~~
/opt/onnx-tensorrt/trt_utils.hpp: In function 'onnx2trt_onnx::TensorProto_DataType onnx2trt::trtDataTypeToONNX(nvinfer1::DataType)':
/opt/onnx-tensorrt/trt_utils.hpp:160:30: error: 'kFP8' is not a member of 'nvinfer1::DataType'
  160 |     case nvinfer1::DataType::kFP8: break;
      |                              ^~~~
In file included from /opt/onnx-tensorrt/ImporterContext.hpp:8,
                 from /opt/onnx-tensorrt/ModelImporter.hpp:7,
                 from /opt/onnx-tensorrt/NvOnnxParser.cpp:6:
/opt/onnx-tensorrt/onnx2trt_utils.hpp: In function 'std::ostream& nvinfer1::operator<<(std::ostream&, const nvinfer1::DataType&)':
/opt/onnx-tensorrt/onnx2trt_utils.hpp:78:30: error: 'kFP8' is not a member of 'nvinfer1::DataType'
   78 |     case nvinfer1::DataType::kFP8: return stream << "float8";
      |                              ^~~~
make[2]: *** [CMakeFiles/nvonnxparser_static.dir/build.make:63: CMakeFiles/nvonnxparser_static.dir/NvOnnxParser.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/nvonnxparser_static.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
kshashankrao commented 11 months ago

I also get this errors.

Is it error related to tensorrt or onnx-tensorrt not finding the data types ?

jonhoo commented 2 months ago

I believe this happens because you're trying to use onnx-tensorrt 8.6 (or higher) with tensorrt 8.5 or lower (which is what JetPack 5 provides). See https://github.com/onnx/onnx-tensorrt/issues/991 for details. I'd probably recommend closing this in favour of that issue.