NVIDIA / retinanet-examples

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

retinanet/_C.so: undefined symbol: _ZN2cv6imreadERKNS_6StringEi #181

Closed VincentDuf closed 4 years ago

VincentDuf commented 4 years ago

Hi guys, I've been working with the repo for a few weeks now and everything went great until I tried to update the repo to get the new MobileNet implementation.

I tried to rebuild the repo after I cloned, everything seems to go well (I can even see the odtk in pip list) but when I invoke it I have the "undefined symbol" error.

I'm working with an Ubuntu16.04 host, CUDA10.2, TensorRT7, Tensorflow1.15.

running clean
removing 'build/temp.linux-x86_64-3.5' (and everything under it)
removing 'build/lib.linux-x86_64-3.5' (and everything under it)
removing 'build/bdist.linux-x86_64' (and everything under it)
'build/scripts-3.5' does not exist -- can't clean it
removing 'build'
running install
running bdist_egg
running egg_info
writing dependency_links to odtk.egg-info/dependency_links.txt
writing top-level names to odtk.egg-info/top_level.txt
writing odtk.egg-info/PKG-INFO
writing requirements to odtk.egg-info/requires.txt
writing entry points to odtk.egg-info/entry_points.txt
package init file 'retinanet/__init__.py' not found (or not a regular file)
reading manifest file 'odtk.egg-info/SOURCES.txt'
writing manifest file 'odtk.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/retinanet
copying retinanet/train.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/utils.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/model.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/infer.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/loss.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/main.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/data.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/dali.py -> build/lib.linux-x86_64-3.5/retinanet
copying retinanet/box.py -> build/lib.linux-x86_64-3.5/retinanet
creating build/lib.linux-x86_64-3.5/retinanet/backbones
copying retinanet/backbones/layers.py -> build/lib.linux-x86_64-3.5/retinanet/backbones
copying retinanet/backbones/utils.py -> build/lib.linux-x86_64-3.5/retinanet/backbones
copying retinanet/backbones/__init__.py -> build/lib.linux-x86_64-3.5/retinanet/backbones
copying retinanet/backbones/fpn.py -> build/lib.linux-x86_64-3.5/retinanet/backbones
copying retinanet/backbones/resnet.py -> build/lib.linux-x86_64-3.5/retinanet/backbones
copying retinanet/backbones/mobilenet.py -> build/lib.linux-x86_64-3.5/retinanet/backbones
running build_ext
building 'retinanet._C' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/csrc
creating build/temp.linux-x86_64-3.5/csrc/cuda
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/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/TH -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/THC -I/usr/local/cuda-10.2/include -I/usr/include/python3.5m -I/home/greenshield/.virtualenvs/cv/include/python3.5m -c csrc/extensions.cpp -o build/temp.linux-x86_64-3.5/csrc/extensions.o -std=c++14 -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++
csrc/extensions.cpp: In function ‘std::vector<at::Tensor> infer(retinanet::Engine&, at::Tensor, bool)’:
csrc/extensions.cpp:175:46: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data<T>() is deprecated. Please use Tensor.data_ptr<T>() instead. [-Wdeprecated-declarations]
         buffers.push_back(buffer.data<float>());
                                              ^
In file included from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/ATen/Tensor.h:11:0,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/ATen/Context.h:4,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
                 from /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/extension.h:4,
                 from csrc/extensions.cpp:29:
/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/ATen/core/TensorBody.h:322:7: note: declared here
   T * data() const {
       ^
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/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/TH -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/THC -I/usr/local/cuda-10.2/include -I/usr/include/python3.5m -I/home/greenshield/.virtualenvs/cv/include/python3.5m -c csrc/engine.cpp -o build/temp.linux-x86_64-3.5/csrc/engine.o -std=c++14 -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++
csrc/engine.cpp: In member function ‘virtual void retinanet::Logger::log(nvinfer1::ILogger::Severity, const char*)’:
csrc/engine.cpp:49:55: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
         if (_verbose || (severity != Severity::kINFO) && (severity != Severity::kVERBOSE))
                                                       ^
/usr/local/cuda-10.2/bin/nvcc -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/TH -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/THC -I/usr/local/cuda-10.2/include -I/usr/include/python3.5m -I/home/greenshield/.virtualenvs/cv/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__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++14 --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 -gencode=arch=compute_72,code=sm_72 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_75,code=compute_75 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
/usr/local/cuda-10.2/bin/nvcc -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/TH -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/THC -I/usr/local/cuda-10.2/include -I/usr/include/python3.5m -I/home/greenshield/.virtualenvs/cv/include/python3.5m -c csrc/cuda/decode_rotate.cu -o build/temp.linux-x86_64-3.5/csrc/cuda/decode_rotate.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++14 --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 -gencode=arch=compute_72,code=sm_72 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_75,code=compute_75 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
/usr/local/cuda-10.2/bin/nvcc -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/TH -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/THC -I/usr/local/cuda-10.2/include -I/usr/include/python3.5m -I/home/greenshield/.virtualenvs/cv/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__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++14 --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 -gencode=arch=compute_72,code=sm_72 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_75,code=compute_75 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0
/usr/local/cuda-10.2/bin/nvcc -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/torch/csrc/api/include -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/TH -I/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/torch/include/THC -I/usr/local/cuda-10.2/include -I/usr/include/python3.5m -I/home/greenshield/.virtualenvs/cv/include/python3.5m -c csrc/cuda/nms_iou.cu -o build/temp.linux-x86_64-3.5/csrc/cuda/nms_iou.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++14 --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 -gencode=arch=compute_72,code=sm_72 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_75,code=compute_75 -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/decode_rotate.o build/temp.linux-x86_64-3.5/csrc/cuda/nms.o build/temp.linux-x86_64-3.5/csrc/cuda/nms_iou.o -L/usr/local/cuda-10.2/lib64 -lnvinfer -lnvinfer_plugin -lnvonnxparser -lcudart -o build/lib.linux-x86_64-3.5/retinanet/_C.so
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/train.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/utils.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/model.py -> build/bdist.linux-x86_64/egg/retinanet
creating build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/backbones/layers.py -> build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/backbones/utils.py -> build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/backbones/__init__.py -> build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/backbones/fpn.py -> build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/backbones/resnet.py -> build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/backbones/mobilenet.py -> build/bdist.linux-x86_64/egg/retinanet/backbones
copying build/lib.linux-x86_64-3.5/retinanet/infer.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/loss.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/main.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/data.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/_C.so -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/dali.py -> build/bdist.linux-x86_64/egg/retinanet
copying build/lib.linux-x86_64-3.5/retinanet/box.py -> build/bdist.linux-x86_64/egg/retinanet
byte-compiling build/bdist.linux-x86_64/egg/retinanet/train.py to train.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/utils.py to utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/model.py to model.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/backbones/layers.py to layers.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/backbones/utils.py to utils.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/backbones/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/backbones/fpn.py to fpn.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/backbones/resnet.py to resnet.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/backbones/mobilenet.py to mobilenet.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/infer.py to infer.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/loss.py to loss.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/main.py to main.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/data.py to data.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/dali.py to dali.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/retinanet/box.py to box.cpython-35.pyc
creating stub loader for retinanet/_C.so
byte-compiling build/bdist.linux-x86_64/egg/retinanet/_C.py to _C.cpython-35.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying odtk.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying odtk.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying odtk.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying odtk.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying odtk.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying odtk.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
retinanet.__pycache__._C.cpython-35: module references __file__
creating 'dist/odtk-0.2.3-py3.5-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing odtk-0.2.3-py3.5-linux-x86_64.egg
creating /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/odtk-0.2.3-py3.5-linux-x86_64.egg
Extracting odtk-0.2.3-py3.5-linux-x86_64.egg to /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Adding odtk 0.2.3 to easy-install.pth file
Installing odtk script to /home/greenshield/.virtualenvs/cv/bin

Installed /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/odtk-0.2.3-py3.5-linux-x86_64.egg
Processing dependencies for odtk==0.2.3
Searching for requests==2.22.0
Best match: requests 2.22.0
Adding requests 2.22.0 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for Pillow==6.2.2
Best match: Pillow 6.2.2
Adding Pillow 6.2.2 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for pycocotools==2.0+nv0.4.0
Best match: pycocotools 2.0+nv0.4.0
Adding pycocotools 2.0+nv0.4.0 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for apex==0.1
Best match: apex 0.1
Adding apex 0.1 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for torchvision==0.5.0
Best match: torchvision 0.5.0
Adding torchvision 0.5.0 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for torch==1.4.0
Best match: torch 1.4.0
Adding torch 1.4.0 to easy-install.pth file
Installing convert-onnx-to-caffe2 script to /home/greenshield/.virtualenvs/cv/bin
Installing convert-caffe2-to-onnx script to /home/greenshield/.virtualenvs/cv/bin

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for certifi==2019.11.28
Best match: certifi 2019.11.28
Adding certifi 2019.11.28 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for urllib3==1.25.8
Best match: urllib3 1.25.8
Adding urllib3 1.25.8 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect script to /home/greenshield/.virtualenvs/cv/bin

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for idna==2.8
Best match: idna 2.8
Adding idna 2.8 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for matplotlib==3.0.3
Best match: matplotlib 3.0.3
Adding matplotlib 3.0.3 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for setuptools==45.1.0
Best match: setuptools 45.1.0
Adding setuptools 45.1.0 to easy-install.pth file
Installing easy_install script to /home/greenshield/.virtualenvs/cv/bin
Installing easy_install-3.8 script to /home/greenshield/.virtualenvs/cv/bin

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for pybind11==2.4.3
Best match: pybind11 2.4.3
Adding pybind11 2.4.3 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for Cython==0.29.14
Best match: Cython 0.29.14
Adding Cython 0.29.14 to easy-install.pth file
Installing cythonize script to /home/greenshield/.virtualenvs/cv/bin
Installing cygdb script to /home/greenshield/.virtualenvs/cv/bin
Installing cython script to /home/greenshield/.virtualenvs/cv/bin

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for six==1.14.0
Best match: six 1.14.0
Adding six 1.14.0 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for numpy==1.17.4
Best match: numpy 1.17.4
Adding numpy 1.17.4 to easy-install.pth file
Installing f2py script to /home/greenshield/.virtualenvs/cv/bin
Installing f2py3 script to /home/greenshield/.virtualenvs/cv/bin
Installing f2py3.5 script to /home/greenshield/.virtualenvs/cv/bin

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for kiwisolver==1.1.0
Best match: kiwisolver 1.1.0
Adding kiwisolver 1.1.0 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for pyparsing==2.4.6
Best match: pyparsing 2.4.6
Adding pyparsing 2.4.6 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for python-dateutil==2.8.1
Best match: python-dateutil 2.8.1
Adding python-dateutil 2.8.1 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Searching for cycler==0.10.0
Best match: cycler 0.10.0
Adding cycler 0.10.0 to easy-install.pth file

Using /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages
Finished processing dependencies for odtk==0.2.3
(cv) greenshield@greenshield-Precision-Tower-3620:~/retinanet-examples$ pip list
Package              Version
-------------------- -----------
absl-py              0.9.0
apex                 0.1
appdirs              1.4.3
astor                0.8.1
certifi              2019.11.28
chardet              3.0.4
clodsa               1.2.39
commentjson          0.8.3
cycler               0.10.0
Cython               0.29.14
decorator            4.4.2
future               0.18.2
gast                 0.2.2
google-pasta         0.1.8
graphsurgeon         0.4.1
grpcio               1.26.0
h5py                 2.10.0
idna                 2.8
imageio              2.8.0
imgaug               0.4.0
imutils              0.5.3
joblib               0.14.1
Keras                2.3.1
Keras-Applications   1.0.8
Keras-Preprocessing  1.1.0
kiwisolver           1.1.0
lark-parser          0.7.8
mahotas              1.4.9
Mako                 1.1.2
Markdown             3.2
MarkupSafe           1.1.1
matplotlib           3.0.3
networkx             2.4
numpy                1.17.4
nvidia-dali          0.18.0
odtk                 0.2.3
opencv-python        4.2.0.32
opt-einsum           3.1.0
pandas               0.24.2
Pillow               6.2.2
pip                  20.0.2
progressbar2         3.50.0
protobuf             3.11.3
pybind11             2.4.3
pycocotools          2.0+nv0.4.0
pycuda               2019.1.2
pyparsing            2.4.6
python-dateutil      2.8.1
python-utils         2.4.0
pytools              2020.1
pytz                 2019.3
PyWavelets           1.1.1
PyYAML               5.3
requests             2.22.0
retinanet            0.2.3
scikit-image         0.15.0
scikit-learn         0.22.1
scipy                1.4.1
seaborn              0.9.1
setuptools           45.1.0
Shapely              1.7.0
six                  1.14.0
sklearn              0.0
tensorboard          1.15.0
tensorboardX         2.0
tensorflow-estimator 1.15.1
tensorflow-gpu       1.15.0
tensorrt             7.0.0.11
termcolor            1.1.0
torch                1.4.0
torch2trt            0.0.3
torchvision          0.5.0
uff                  0.6.5
urllib3              1.25.8
Werkzeug             1.0.0
wheel                0.34.2
wrapt                1.11.2
(cv) greenshield@greenshield-Precision-Tower-3620:~/retinanet-examples$ cd ..
(cv) greenshield@greenshield-Precision-Tower-3620:~$ odtk -h
Traceback (most recent call last):
  File "/home/greenshield/.virtualenvs/cv/bin/odtk", line 11, in <module>
    load_entry_point('odtk==0.2.3', 'console_scripts', 'odtk')()
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2853, in load_entry_point
    return ep.load()
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2444, in load
    return self.resolve()
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2450, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/retinanet-0.2.3-py3.5-linux-x86_64.egg/retinanet/main.py", line 10, in <module>
    from retinanet import infer, train, utils
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/retinanet-0.2.3-py3.5-linux-x86_64.egg/retinanet/infer.py", line 13, in <module>
    from .model import Model
  File "/home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/retinanet-0.2.3-py3.5-linux-x86_64.egg/retinanet/model.py", line 9, in <module>
    from ._C import Engine
ImportError: /home/greenshield/.virtualenvs/cv/lib/python3.5/site-packages/retinanet-0.2.3-py3.5-linux-x86_64.egg/retinanet/_C.so: undefined symbol: _ZN2cv6imreadERKNS_6StringEi

I want to precise that I made a second "setup.py" script with modifications:

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
setup(
    name='retinanet',
    version='0.2.3',
    description='Fast and accurate single shot object detector',
    author = 'NVIDIA Corporation',
    packages=['retinanet', 'retinanet.backbones'],
    ext_modules=[CUDAExtension('retinanet._C',
        ['csrc/extensions.cpp', 'csrc/engine.cpp', 'csrc/cuda/decode.cu', 'csrc/cuda/decode_rotate.cu', 'csrc/cuda/nms.cu', 'csrc/cuda/nms_iou.cu'],
        extra_compile_args={
            'cxx': ['-std=c++14', '-O2', '-Wall'],
            'nvcc': [
                '-std=c++14', '--expt-extended-lambda', '--use_fast_math', '-Xcompiler', '-Wall',
                '-gencode=arch=compute_50,code=sm_50','-gencode=arch=compute_50,code=compute_50',
                '-gencode=arch=compute_52,code=sm_52','-gencode=arch=compute_52,code=compute_52',
                '-gencode=arch=compute_60,code=sm_60', '-gencode=arch=compute_60,code=compute_60',
                '-gencode=arch=compute_61,code=sm_61','-gencode=arch=compute_61,code=compute_61'
               # '-gencode=arch=compute_70,code=sm_70', '-gencode=arch=compute_72,code=sm_72',
               # '-gencode=arch=compute_75,code=sm_75', '-gencode=arch=compute_75,code=compute_75'
            ],
        },
        library_dirs = ['/usr/local/lib'],
        libraries=['nvinfer', 'nvinfer_plugin', 'nvonnxparser','opencv_core','opencv_imgproc','opencv_highgui'])
    ],
    cmdclass={'build_ext': BuildExtension.with_options(no_python_abi_suffix=True)},
    install_requires=[
        'torch>=1.0.0a0',
        'torchvision',
        'apex @ git+https://github.com/NVIDIA/apex',
        'pycocotools @ git+https://github.com/nvidia/cocoapi.git#subdirectory=PythonAPI',
        'pillow',
        'requests',
    ],
    entry_points = {'console_scripts': ['retinanet=retinanet.main:main']}
)

With this I get "retinanet" to be installed (because of the change in certain variable) but I get the same error when I invoke the command...

If you have any ideas how to deal with it I take ! It's even more frustrating that I had the issue when I first attempt to compile the repo and by adding the changes it worked, I don't get why it doesn't now.

Thanks

ghost commented 4 years ago

Hey, can you change entry_points = {'console_scripts': ['retinanet=retinanet.main:main']} to entry_points = {'console_scripts': ['odtk=retinanet.main:main']}

Also try extending libraries to libraries=['nvinfer', 'nvinfer_plugin', 'nvonnxparser', 'opencv_core', 'opencv_highgui', 'opencv_imgproc', 'opencv_imgcodecs']) and library_dirs to ['/usr/local/lib', '/usr/local/lib64/']

VincentDuf commented 4 years ago

Just noticed I forgot the _"opencvimgcodecs" in the library list... it works now.

james-nvidia commented 4 years ago

Please see here for MobileNetV2FPN pre-trained model: https://github.com/NVIDIA/retinanet-examples/releases/tag/v0.2.3

azuryl commented 4 years ago

Please see here for MobileNetV2FPN pre-trained model: https://github.com/NVIDIA/retinanet-examples/releases/tag/v0.2.3

this link can not open