Onnx-tensorrt: does not contain a CMakeLists.txt file.

Created on 20 Dec 2019  路  4Comments  路  Source: onnx/onnx-tensorrt

Hello,
I am trying to convert from onnx to tensorRT but I am getting this issue while converting.

Please help me to resolve this

Make Error at CMakeLists.txt:100 (add_subdirectory):
The source directory

/home/bplus/Desktop/UNIT_MASTER_THESIS/UNIT/unit1/UNIT_Working/onnx-tensorrt/third_party/onnx

does not contain a CMakeLists.txt file.

-- Found TensorRT headers at /usr/include/x86_64-linux-gnu
-- Find TensorRT libs at /usr/src/TensorRT-5.1.5.0/lib/libnvinfer.so;/usr/src/TensorRT-5.1.5.0/lib/libnvinfer_plugin.so;TENSORRT_LIBRARY_MYELIN-NOTFOUND
-- Could NOT find TENSORRT (missing: TENSORRT_LIBRARY)
ERRORCannot find TensorRT library.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
TENSORRT_LIBRARY_MYELIN
linked by target "nvonnxparser_static" in directory /home/bplus/Desktop/UNIT_MASTER_THESIS/UNIT/unit1/UNIT_Working/onnx-tensorrt
linked by target "nvonnxparser" in directory /home/bplus/Desktop/UNIT_MASTER_THESIS/UNIT/unit1/UNIT_Working/onnx-tensorrt

-- Configuring incomplete, errors occurred!
See also "/home/bplus/Desktop/UNIT_MASTER_THESIS/UNIT/unit1/UNIT_Working/onnx-tensorrt/build/CMakeFiles/CMakeOutput.log".
See also "/home/bplus/Desktop/UNIT_MASTER_THESIS/UNIT/unit1/UNIT_Working/onnx-tensorrt/build/CMakeFiles/CMakeError.log".

question triaged

Most helpful comment

This is a different error. Try git submodule update --init --recursive or git clone --recurse-submodules https://github.com/onnx/onnx-tensorrt.git (if it's not cloned already). I had a similar error, and it was because the repository in https://github.com/onnx/onnx-tensorrt/tree/master/third_party was not updated (onnx). I hope this helps! @kshamaramesh

All 4 comments

This is a different error. Try git submodule update --init --recursive or git clone --recurse-submodules https://github.com/onnx/onnx-tensorrt.git (if it's not cloned already). I had a similar error, and it was because the repository in https://github.com/onnx/onnx-tensorrt/tree/master/third_party was not updated (onnx). I hope this helps! @kshamaramesh

what you should do:

  1. git clone --recursive -b xxx https://github.com/onnx/onnx-tensorrt.git xxx means your selected branch, for example tensorRt7.0, you should do it git clone --recursive -b 7.0 https://github.com/onnx/onnx-tensorrt.git
  1. cd onnx-tensorrt
  2. mkdir build
  3. modify your CMakeLists.txt
set(TENSORRT_ROOT your tensorRt path)
include_directories(/usr/local/cuda-10.0/include/)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_BUILD_TYPE Release)
set(GPU_ARCHS 61) 
find_package(Threads)
  1. just run cmake ..
  2. make

Closing this issue as it's been solved (clone with the recursive option to initialize submodules).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

basaltzhang picture basaltzhang  路  5Comments

perrywu1989 picture perrywu1989  路  7Comments

skmhrk1209 picture skmhrk1209  路  6Comments

zhanghongruiupup picture zhanghongruiupup  路  8Comments

jinfagang picture jinfagang  路  3Comments