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".
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:
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)
Closing this issue as it's been solved (clone with the recursive option to initialize submodules).
Most helpful comment
This is a different error. Try
git submodule update --init --recursiveorgit 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