tf_to_trt_image_classification icon indicating copy to clipboard operation
tf_to_trt_image_classification copied to clipboard

A problem when make

Open fujingling opened this issue 6 years ago • 8 comments

I got a error when I make the project, who knows how can I solve it? cuda version :8.0 TensorRT :3.0.4 env: Ubantu

The following is the error information: `project/tf_to_trt_image_classification-master/examples/classify_image/classify_image.cu:10:21: fatal error: NvInfer.h: No such file or directory #include <NvInfer.h> ^ compilation terminated. CMake Error at classify_image_generated_classify_image.cu.o.cmake:207 (message): Error generating /project/tf_to_trt_image_classification-master/build/examples/classify_image/CMakeFiles/classify_image.dir//./classify_image_generated_classify_image.cu.o

make[2]: *** [examples/classify_image/CMakeFiles/classify_image.dir/classify_image_generated_classify_image.cu.o] Error 1 make[1]: *** [examples/classify_image/CMakeFiles/classify_image.dir/all] Error 2 make: *** [all] Error 2`

fujingling avatar May 24 '18 13:05 fujingling

Hello. This project is currently targeting Jetson TX2 / JetPack 3.2.

Did you flash your Jetson using the latest JetPack 3.2? This should install CUDA 9.0 and TensorRT 3.0.4 (which includes NvInfer.h).

ghost avatar May 24 '18 15:05 ghost

Hi, is there a way to make this work for 1080ti? A cmake beginner here, any help would be appreciated!

mikeliao97 avatar Jun 15 '18 22:06 mikeliao97

Hi Mike,

I was able to get over this error by installing tensorrt with tar and adding the header files to LD_LIBRARY_PATH

All header files are under TensorRT-3.0.4/include/ NvCaffeParser.h NvInfer.h NvInferPlugin.h NvUffParser.h NvUtils.h

But I ran into the error below haha [ 25%] Building NVCC (Device) object examples/classify_image/CMakeFiles/classify_image.dir/classify_image_generated_classify_image.cu.o [ 50%] Linking CXX executable classify_image [ 50%] Built target classify_image Scanning dependencies of target uff_to_plan [ 75%] Building CXX object src/CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o [100%] Linking CXX executable uff_to_plan CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o: In function nvinfer1::(anonymous namespace)::createInferBuilder(nvinfer1::ILogger&)': uff_to_plan.cpp:(.text+0x19): undefined reference to createInferBuilder_INTERNAL' CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o: In function main': uff_to_plan.cpp:(.text+0x529): undefined reference to nvuffparser::createUffParser()' collect2: error: ld returned 1 exit status src/CMakeFiles/uff_to_plan.dir/build.make:94: recipe for target 'src/uff_to_plan' failed make[2]: *** [src/uff_to_plan] Error 1 CMakeFiles/Makefile2:158: recipe for target 'src/CMakeFiles/uff_to_plan.dir/all' failed make[1]: *** [src/CMakeFiles/uff_to_plan.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

jma100 avatar Jul 13 '18 22:07 jma100

I solved this problem by replacing cv::Mat image= cv::imread(imageFilename, CV_LOAD_IMAGE_COLOR); line with cv::Mat image = cv::imread(imageFileName);

HilmiK avatar Jul 26 '18 07:07 HilmiK

Another make error

screenshot from 2018-09-01 15-48-03

Installed TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-9.0.cudnn7.0.tar.gz, error same for latest TensorRT-4.0.1.6.Ubuntu-16.04.4.x86_64-gnu.cuda-9.0.cudnn7.1.tar.gz

Any help would be appreciated.

Thanks a lot!

vinayak-gosale avatar Sep 01 '18 14:09 vinayak-gosale

Any news for this error ? I met the exact same error even with TensorRT-4.0.1.6.Ubuntu-16.04.4.x86_64-gnu.cuda-9.0.cudnn7.1.tar.gz..

VincentDuf avatar Feb 22 '19 14:02 VincentDuf

Another make error

screenshot from 2018-09-01 15-48-03

Installed TensorRT-3.0.4.Ubuntu-16.04.3.x86_64.cuda-9.0.cudnn7.0.tar.gz, error same for latest TensorRT-4.0.1.6.Ubuntu-16.04.4.x86_64-gnu.cuda-9.0.cudnn7.1.tar.gz

Any help would be appreciated.

Thanks a lot!

As stated in the log, the nvuffparser::IUffParser::registerInput method requires 3 arguments (see the docs).

Try to use UffInputOrder::kNCHW as third argument or any other enum value declared in NvUffParser.h.

Jonas1302 avatar Mar 16 '19 09:03 Jonas1302

Try sudo aptitude install libnvinfer5 libnvinfer-dev

mcmindcoder avatar Mar 28 '19 01:03 mcmindcoder