NVIDIA / retinanet-examples

Fast and accurate object detection with end-to-end GPU optimization
BSD 3-Clause "New" or "Revised" License
887 stars 271 forks source link

cannot find -lnvinfer #48

Closed dexception closed 5 years ago

dexception commented 5 years ago
running build
running build_py
package init file 'retinanet/__init__.py' not found (or not a regular file)
running build_ext
building 'retinanet._C' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda-9.0/include -I/usr/include/python3.5m -c csrc/extensions.cpp -o build/temp.linux-x86_64-3.5/csrc/extensions.o -std=c++11 -O2 -Wall -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda-9.0/include -I/usr/include/python3.5m -c csrc/engine.cpp -o build/temp.linux-x86_64-3.5/csrc/engine.o -std=c++11 -O2 -Wall -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda-9.0/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda-9.0/include -I/usr/include/python3.5m -c csrc/cuda/decode.cu -o build/temp.linux-x86_64-3.5/csrc/cuda/decode.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 --expt-extended-lambda --use_fast_math -Xcompiler -Wall -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
/usr/local/cuda-9.0/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda-9.0/include -I/usr/include/python3.5m -c csrc/cuda/nms.cu -o build/temp.linux-x86_64-3.5/csrc/cuda/nms.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 --expt-extended-lambda --use_fast_math -Xcompiler -Wall -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/csrc/extensions.o build/temp.linux-x86_64-3.5/csrc/engine.o build/temp.linux-x86_64-3.5/csrc/cuda/decode.o build/temp.linux-x86_64-3.5/csrc/cuda/nms.o -L/usr/local/cuda-9.0/lib64 -lnvinfer -lnvinfer_plugin -lnvonnxparser -lcudart -o build/lib.linux-x86_64-3.5/retinanet/_C.so
/usr/bin/ld: cannot find -lnvinfer
/usr/bin/ld: cannot find -lnvinfer_plugin
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1

echo $LD_LIBRARY_PATH /opt/nvidia/TensorRT-5.0.2.6/lib/:/usr/local/lib:/usr/local/cuda-9.0/lib64

jmsinusa commented 5 years ago

Please edit your question to state your environment, hardware etc.

dexception commented 5 years ago

@jmsinusa Thanks for the quick reply.

ubuntu 16.04 python 3.5.2 cuda 9 TensorRT-5.0.2.6

hardware lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 158 Model name: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz Stepping: 9 CPU MHz: 799.968 CPU max MHz: 3800.0000 CPU min MHz: 800.0000 BogoMIPS: 5615.86 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K NUMA node0 CPU(s): 0-7 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb invpcid_single intel_pt ssbd ibrs ibpb stibp kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d

nvidia-smi Wed Jun 26 01:39:25 2019
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 384.130 Driver Version: 384.130 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 105... Off | 00000000:01:00.0 Off | N/A | | N/A 44C P8 N/A / N/A | 336MiB / 4041MiB | 0% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1245 G /usr/lib/xorg/Xorg 182MiB | | 0 3089 G compiz 153MiB | +-----------------------------------------------------------------------------+

jmsinusa commented 5 years ago

Are you using the NGC docker container?

dexception commented 5 years ago

No

jmsinusa commented 5 years ago

Are you able to use it? If so, your driver problems should be solved.

dexception commented 5 years ago

Can you tell me about the dependencies for this repo ?

jmsinusa commented 5 years ago

I can't, but I can say that they will be met if you can use the container. I believe @monocongo is using this code without the container, so he might be able to help.

dexception commented 5 years ago

Let me get back to you once i run this on docker.

monocongo commented 5 years ago

@dexception you are asking for headaches if you want to run this outside of the NVIDIA PyTorch Docker container. At least I was not Jedi enough to build an environment to allow for running this code outside of the recommended container, it's one of the reasons I've given up on using this model (for now). Please comment here and/or in #38 if you manage to work it out. Best of luck!

jmsinusa commented 5 years ago

@dexception Did you get this working in the container? If so, can you close this issue? Or perhaps open a new one if you have a new specific problem.

goktug97 commented 5 years ago

Install TensorRT using apt. It works for me outside of the container https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html

monocongo commented 5 years ago

@goktug97 what is the platform you're running this model on outside of the Docker container? My interest is in using the model on a Jetson Nano, but for a number of reasons it turned out to not be possible when I tried to do this, but it may be that the Docker requirement was the final roadblock (I forget now which hurdle made me finally abandon trying to use this RetinaNet implementation), and if so maybe I should give it another go? Thanks in advance for any insight/guidance...

goktug97 commented 5 years ago

I tried to train it on my old laptop which has CUDA capable GPU but it turned out to be not sufficient enough to train this model. The laptop is currently running Xubuntu 18.04. After the training, my goal is to use this model in Jetson TX2. I don't have the Jetson with me but as far as I remember the JetPack version of the Linux uses different include path for the libraries (aarch64-linux-gnu). Also if CUDA arch code isn't included in the setup.py file add that.

Edit: Using ‘—batch 1’ solved the insufficient GPU problem

james-nvidia commented 5 years ago

Closing this issue as the original problem seems to have been resolved. Please open a new issue if there are any more problems.