Ghustwb / MobileNet-SSD-TensorRT

Accelerate mobileNet-ssd with tensorRT
188 stars 91 forks source link

It works wrong on Jetson TX2 #14

Open jn0 opened 5 years ago

jn0 commented 5 years ago

Using Nvidia Jetson TX2, fresh install, with these packages

ii  cuda-command-line-tools-9-0                9.0.252-1                                     arm64        CUDA command-line tools
ii  cuda-core-9-0                              9.0.252-1                                     arm64        CUDA core tools
ii  cuda-cublas-9-0                            9.0.252-1                                     arm64        CUBLAS native runtime libraries
ii  cuda-cublas-dev-9-0                        9.0.252-1                                     arm64        CUBLAS native dev links, headers
ii  cuda-cudart-9-0                            9.0.252-1                                     arm64        CUDA Runtime native Libraries
ii  cuda-cudart-dev-9-0                        9.0.252-1                                     arm64        CUDA Runtime native dev links, headers
ii  cuda-cufft-9-0                             9.0.252-1                                     arm64        CUFFT native runtime libraries
ii  cuda-cufft-dev-9-0                         9.0.252-1                                     arm64        CUFFT native dev links, headers
ii  cuda-curand-9-0                            9.0.252-1                                     arm64        CURAND native runtime libraries
ii  cuda-curand-dev-9-0                        9.0.252-1                                     arm64        CURAND native dev links, headers
ii  cuda-cusolver-9-0                          9.0.252-1                                     arm64        CUDA solver native runtime libraries
ii  cuda-cusolver-dev-9-0                      9.0.252-1                                     arm64        CUDA solver native dev links, headers
ii  cuda-cusparse-9-0                          9.0.252-1                                     arm64        CUSPARSE native runtime libraries
ii  cuda-cusparse-dev-9-0                      9.0.252-1                                     arm64        CUSPARSE native dev links, headers
ii  cuda-documentation-9-0                     9.0.252-1                                     arm64        CUDA documentation
ii  cuda-driver-dev-9-0                        9.0.252-1                                     arm64        CUDA Driver native dev stub library
ii  cuda-libraries-dev-9-0                     9.0.252-1                                     arm64        CUDA Libraries 9.0 development meta-package
ii  cuda-license-9-0                           9.0.252-1                                     arm64        CUDA licenses
ii  cuda-misc-headers-9-0                      9.0.252-1                                     arm64        CUDA miscellaneous headers
ii  cuda-npp-9-0                               9.0.252-1                                     arm64        NPP native runtime libraries
ii  cuda-npp-dev-9-0                           9.0.252-1                                     arm64        NPP native dev links, headers
ii  cuda-nvgraph-9-0                           9.0.252-1                                     arm64        NVGRAPH native runtime libraries
ii  cuda-nvgraph-dev-9-0                       9.0.252-1                                     arm64        NVGRAPH native dev links, headers
ii  cuda-nvml-dev-9-0                          9.0.252-1                                     arm64        NVML native dev links, headers
ii  cuda-nvrtc-9-0                             9.0.252-1                                     arm64        NVRTC native runtime libraries
ii  cuda-nvrtc-dev-9-0                         9.0.252-1                                     arm64        NVRTC native dev links, headers
ii  cuda-repo-l4t-9-0-local                    9.0.252-1                                     arm64        cuda repository configuration files
ii  cuda-samples-9-0                           9.0.252-1                                     arm64        CUDA example applications
ii  cuda-toolkit-9-0                           9.0.252-1                                     arm64        CUDA Toolkit 9.0 meta-package
ii  libcudnn7                                  7.1.5.14-1+cuda9.0                            arm64        cuDNN runtime libraries
ii  libcudnn7-dev                              7.1.5.14-1+cuda9.0                            arm64        cuDNN development libraries and headers
ii  libcudnn7-doc                              7.1.5.14-1+cuda9.0                            arm64        cuDNN documents and samples
ii  libnvinfer-dev                             4.1.3-1+cuda9.0                               arm64        TensorRT development libraries and headers
ii  libnvinfer-samples                         4.1.3-1+cuda9.0                               arm64        TensorRT samples and documentation
ii  libnvinfer4                                4.1.3-1+cuda9.0                               arm64        TensorRT runtime libraries
ii  tensorrt                                   4.0.2.0-1+cuda9.0                             arm64        Meta package of TensorRT

and with these defines

#define NV_TENSORRT_MAJOR 4 //!< TensorRT major version.
#define NV_TENSORRT_MINOR 0 //!< TensorRT minor version.
#define NV_TENSORRT_PATCH 2 //!< TensorRT patch version.
#define NV_TENSORRT_BUILD 0 //!< TensorRT build number.

#define NV_TENSORRT_SONAME_MAJOR 4 //!< Shared object library major version number.
#define NV_TENSORRT_SONAME_MINOR 1 //!< Shared object library minor version number.
#define NV_TENSORRT_SONAME_PATCH 3 //!< Shared object library patch version number.

in /usr/include/aarch64-linux-gnu/NvInfer.h it gives

image

attempting to open cache file ../../model/MobileNetSSD_deploy.caffemodel.1.tensorcache
loading network profile from cache...
createInference
2_softmax
2_detection_out
createInference_end
Bindings after deserializing:
Binding 0 (data): Input.
Binding 1 (detection_out): Output.
Allocate memory: input blob
allocate data
Allocate memory: output blob
allocate output
0.160521 , 0.179899 , 0.351957 , 0.714393
0.580017 , 0.174322 , 0.784316 , 0.736432
0.413608 , 0.159625 , 0.595889 , 0.726053
0.000298329 , 0.373827 , 0.209366 , 0.635824
0.338725 , 0.275225 , 0.457445 , 0.66792
0.236015 , 0.194621 , 0.419907 , 0.727357
0.303909 , 0.27831 , 0.374488 , 0.605555
0.155144 , 0.36166 , 0.227306 , 0.66111
0.51822 , 0.325927 , 0.622801 , 0.700739
0.394651 , 0.231804 , 0.47706 , 0.608612
0.137143 , 0.229672 , 0.221782 , 0.533472
0.805657 , 0.316405 , 0.892924 , 0.630012
0.300952 , 0.424454 , 0.492521 , 0.719962
0.286159 , 0.322753 , 0.40298 , 0.690346
0.0566538 , 0.329556 , 0.308375 , 0.661921
0.0507843 , 0.427002 , 0.283697 , 0.584319
0.0226981 , 0.503433 , 0.254028 , 0.661167
0.155144 , 0.36166 , 0.227306 , 0.66111
0.000288054 , 0.478121 , 0.384935 , 0.732708
0.177882 , 0.204922 , 0.833934 , 0.77984
0.00984597 , 0.476518 , 0.926414 , 0.993194
0 , 0.42333 , 0.284814 , 0.658839
0.00240755 , 0.413551 , 0.0775371 , 0.622686
0 , 0.485509 , 0.13807 , 0.610267
0.0330818 , 0.352652 , 0.187628 , 0.472965
0.00896727 , 0.417102 , 0.14612 , 0.57539
0.0558874 , 0.539785 , 0.231099 , 0.723213
0.3153 , 0.327529 , 0.464135 , 0.600311
0.101324 , 0.584882 , 0.267479 , 0.710831
0 , 0.242435 , 0.580386 , 0.747623
0.0305635 , 0.384605 , 0.13506 , 0.503647
0 , 0.524516 , 0.492444 , 0.857428
0.289528 , 0.388107 , 0.390684 , 0.52256
0.0543259 , 0.567055 , 0.154639 , 0.671858
0.0781092 , 0.595458 , 0.182098 , 0.661447
0.000298329 , 0.373827 , 0.209366 , 0.635824
0.177882 , 0.204922 , 0.833934 , 0.77984
0.0566538 , 0.329556 , 0.308375 , 0.661921
0.0286795 , 0.0125149 , 0.841668 , 0.597584
0 , 0.242435 , 0.580386 , 0.747623
0.115826 , 0 , 0.901469 , 0.271405
0 , 0.136121 , 0.474437 , 0.481822
0.00295338 , 0.38081 , 0.111221 , 0.538201
0 , 0 , 0.417294 , 0.323122
0.0330818 , 0.352652 , 0.187628 , 0.472965
0 , 0.216587 , 0.269543 , 0.494779
0.507684 , 0.53427 , 1 , 0.862502
0.333895 , 0 , 1 , 0.38035
0.455289 , 0.21072 , 1 , 0.762372
0 , 0.513718 , 0.761851 , 0.833565
9.11802e-05 , 0 , 0.391233 , 0.624349
0.047419 , 0.359526 , 0.135353 , 0.443856
0.0566538 , 0.329556 , 0.308375 , 0.661921
0.000298329 , 0.373827 , 0.209366 , 0.635824
0.420242 , 0.172266 , 0.582335 , 0.645928
0.0305635 , 0.384605 , 0.13506 , 0.503647
0.338725 , 0.275225 , 0.457445 , 0.66792
0 , 0.00798881 , 0.363116 , 0.738297
0 , 0 , 0.250309 , 0.486873
0 , 0.216587 , 0.269543 , 0.494779
0.12848 , 0.47811 , 0.543521 , 0.759041
0.00240755 , 0.413551 , 0.0775371 , 0.622686
0.476562 , 0.821771 , 1 , 0.971772
0.00896727 , 0.417102 , 0.14612 , 0.57539
0.000288054 , 0.478121 , 0.384935 , 0.732708
0.743723 , 0.351719 , 1 , 0.988543
0.287176 , 0.050057 , 0.701922 , 0.759556
0.155144 , 0.36166 , 0.227306 , 0.66111
0.361402 , 0.489218 , 0.773844 , 0.766053
0.047419 , 0.359526 , 0.135353 , 0.443856
0.568539 , 0.174267 , 0.809359 , 0.753875
0.139102 , 0 , 0.451539 , 0.535674
0.0126136 , 0.822241 , 0.551643 , 0.978369
0.764938 , 0 , 1 , 0.506245
0.143949 , 0.188334 , 0.381128 , 0.730597
0.64835 , 0 , 0.995357 , 0.754575
0 , 0.603846 , 0.388759 , 1
0.245007 , 0 , 0.745477 , 0.367092
0.0330818 , 0.352652 , 0.187628 , 0.472965
0.143508 , 0.704635 , 0.745253 , 0.987022
0.543932 , 0 , 0.858451 , 0.549616
0.0507843 , 0.427002 , 0.283697 , 0.584319
0.5334 , 0.485179 , 0.938008 , 0.780334

(process:11109): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.
distroyPlugin
jn0 commented 5 years ago

Hm-hm...

After manual reinstall of OpenCV it works as expected

image

Ghustwb commented 5 years ago

Great!

MengMengDaXiaoJi commented 5 years ago

Hello, I need some help. I also use jetson tx2, I get an exception when run the mobileNet(demo). error:(-215:Assertion failed) !ssize.empty() in function 'resize'

MengMengDaXiaoJi commented 5 years ago

haha , I found the reason at main.cpp

chiemon commented 5 years ago

Hm-hm...

After manual reinstall of OpenCV it works as expected

image

Hi, I have met the same problem on tx2. but I don't want to reinstall opencv. do you have anyother ideas to solver the problem? and i was confused by the method of reinstall opencv?

jyphaoshuai commented 5 years ago

haha , I found the reason at main.cpp hello,i also have "resize" problem.How do you solve this problem ? please