onnx-tensorrt/builtin_op_importers.cpp:766:12: error: ‘class nvinfer1::IDeconvolutionLayer’ has no m

When compiling the onnxruntime source code, an error is reported:

/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:766:12: error: ‘class nvinfer1::IDeconvolutionLayer’ has no member named ‘setDilationNd’
     layer->setDilationNd(dilations);
            ^~~~~~~~~~~~~
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp: In function ‘onnx2trt::NodeImportResult onnx2trt::{anonymous}::importGemm(onnx2trt::IImporterContext*, const onnx::NodeProto&, std::vector<onnx2trt::TensorOrWeights>&)’:
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:1250:18: error: ‘class nvinfer1::IShuffleLayer’ has no member named ‘setZeroIsPlaceholder’
         squeeze->setZeroIsPlaceholder(false);
                  ^~~~~~~~~~~~~~~~~~~~
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp: In function ‘onnx2trt::NodeImportResult onnx2trt::{anonymous}::importGRU(onnx2trt::IImporterContext*, const onnx::NodeProto&, std::vector<onnx2trt::TensorOrWeights>&)’:
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:1536:20: error: ‘class nvinfer1::IShuffleLayer’ has no member named ‘setZeroIsPlaceholder’
         unsqueeze->setZeroIsPlaceholder(false);
                    ^~~~~~~~~~~~~~~~~~~~
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp: In function ‘onnx2trt::NodeImportResult onnx2trt::{anonymous}::importLSTM(onnx2trt::IImporterContext*, const onnx::NodeProto&, std::vector<onnx2trt::TensorOrWeights>&)’:
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:2051:22: error: ‘class nvinfer1::IShuffleLayer’ has no member named ‘setZeroIsPlaceholder’
         reshapeBias->setZeroIsPlaceholder(false);
                      ^~~~~~~~~~~~~~~~~~~~
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp: In function ‘onnx2trt::NodeImportResult onnx2trt::{anonymous}::importRNN(onnx2trt::IImporterContext*, const onnx::NodeProto&, std::vector<onnx2trt::TensorOrWeights>&)’:
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:3202:22: error: ‘class nvinfer1::IShuffleLayer’ has no member named ‘setZeroIsPlaceholder’
         reshapeBias->setZeroIsPlaceholder(false);
                      ^~~~~~~~~~~~~~~~~~~~
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp: In function ‘onnx2trt::NodeImportResult onnx2trt::{anonymous}::importTRT_Shuffle(onnx2trt::IImporterContext*, const onnx::NodeProto&, std::vector<onnx2trt::TensorOrWeights>&)’:
/home/zxq/cxx/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:4219:12: error: ‘class nvinfer1::IShuffleLayer’ has no member named ‘setZeroIsPlaceholder’
     layer->setZeroIsPlaceholder(zeroIsPlaceholder);
            ^~~~~~~~~~~~~~~~~~~~
external/onnx-tensorrt/CMakeFiles/nvonnxparser_static.dir/build.make:103: recipe for target 'external/onnx-tensorrt/CMakeFiles/nvonnxparser_static.dir/builtin_op_importers.cpp.o' failed
make[2]: *** [external/onnx-tensorrt/CMakeFiles/nvonnxparser_static.dir/builtin_op_importers.cpp.o] Error 1
CMakeFiles/Makefile2:2581: recipe for target 'external/onnx-tensorrt/CMakeFiles/nvonnxparser_static.dir/all' failed
make[1]: *** [external/onnx-tensorrt/CMakeFiles/nvonnxparser_static.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "/home/zxq/cxx/onnxruntime/tools/ci_build/build.py", line 1986, in <module>
    sys.exit(main())
  File "/home/zxq/cxx/onnxruntime/tools/ci_build/build.py", line 1921, in main
    build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, args.target)
  File "/home/zxq/cxx/onnxruntime/tools/ci_build/build.py", line 1007, in build_targets
    run_subprocess(cmd_args, env=env)
  File "/home/zxq/cxx/onnxruntime/tools/ci_build/build.py", line 528, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "/home/zxq/cxx/onnxruntime/tools/python/util/run.py", line 41, in run
    completed_process = subprocess.run(
  File "/home/zxq/anaconda3/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/bin/cmake', '--build', '/home/zxq/cxx/onnxruntime/build/Linux/Release', '--config', 'Release']' returned non-zero exit status 2.

reason:

From the error message, we can see that it is related to the third-party package external/onnx tensorrt of oonnxruntime, and then we can see that

Onnx runtime – rel-1.7.2 is the third-party package onnx tensorrt. This package depends on tensorrt version 7.2.2, but I installed 7.0.0, which is too low.

The reason why I installed 7.0.0 is that I installed CUDA 10.0 before, and CUDA 10.0 supports tensorrt 7.0.0 at most.

terms of settlement:

(1) Download the appropriate version of onnxruntime again. The download is too slow and the time cost is too high.

(2) Update CUDA 11.0, CUDA 11.0 can support the latest tensorrt 7.2.3, re install CUDA and tensorrt reference tutorial.

 


Read More: