Closed tehkillerbee closed 2 years ago
Hi, we have tested detection models on Jetson TX2 and Xavier. We haven't seen the issue before. Could you please provide your model_cfg, deploy_cfg, deploy command as well as your TensorRT version on both platforms? We can try to reproduce this issue.
@SingleZombie Thank you. Which versions of Jetpack have you tested with? I can also test with a TX2 or a Xavier NX if necessary.
I have gotten our Jetson AGX platform upgraded to latest Jetpack 4.6 with a later TensorRT version 8.0.1.6. My initial tests show that the inference results appear correct in both pytorch and tensorrt engine. MMdeploy works as expected with the following configuration:
nvidia@ax720_01:~/git/jetsonUtilities$ ./jetsonInfo.py
NVIDIA Jetson UNKNOWN
L4T 32.6.1 [ JetPack 4.6 ]
Ubuntu 18.04.6 LTS
Kernel Version: 4.9.253-tegra
CUDA 10.2.300
CUDA Architecture: NONE
OpenCV version: 4.1.1
OpenCV Cuda: NO
CUDNN: 8.2.1.32
TensorRT: 8.0.1.6
Vision Works: 1.6.0.501
VPI: ii libnvvpi1 1.1.12 arm64 NVIDIA Vision Programming Interface library
Vulcan: 1.2.70
(venv-mmdet) nvidia@agx:~/git/project$ python ./MMDeploy/tools/check_env.py
2022-02-07 09:53:09,332 - mmdeploy - INFO - sys.platform: linux
2022-02-07 09:53:09,333 - mmdeploy - INFO - Python: 3.6.9 (default, Dec 8 2021, 21:08:43) [GCC 8.4.0]
2022-02-07 09:53:09,333 - mmdeploy - INFO - CUDA available: True
2022-02-07 09:53:09,333 - mmdeploy - INFO - GPU 0: Xavier
2022-02-07 09:53:09,334 - mmdeploy - INFO - CUDA_HOME: /usr/local/cuda-10.2
2022-02-07 09:53:09,334 - mmdeploy - INFO - NVCC: Build cuda_10.2_r440.TC440_70.29663091_0
2022-02-07 09:53:09,334 - mmdeploy - INFO - GCC: gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
2022-02-07 09:53:09,334 - mmdeploy - INFO - PyTorch: 1.10.0
2022-02-07 09:53:09,334 - mmdeploy - INFO - PyTorch compiling details: PyTorch built with:
- GCC 7.5
- C++ Version: 201402
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: NO AVX
- CUDA Runtime 10.2
- NVCC architecture flags: -gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_62,code=sm_62;-gencode;arch=compute_72,code=sm_72
- CuDNN 8.2.1
- Built with CuDNN 8.0
- Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=8.0.0, CXX_COMPILER=/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -DMISSING_ARM_VST1 -DMISSING_ARM_VLD1 -Wno-stringop-overflow, FORCE_FALLBACK_CUDA_MPI=1, LAPACK_INFO=open, TORCH_VERSION=1.10.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=OFF, USE_MPI=ON, USE_NCCL=0, USE_NNPACK=ON, USE_OPENMP=ON,
2022-02-07 09:53:09,334 - mmdeploy - INFO - TorchVision: 0.11.1 2022-02-07 09:53:09,334 - mmdeploy - INFO - OpenCV: 4.5.5 2022-02-07 09:53:09,334 - mmdeploy - INFO - MMCV: 1.4.1 2022-02-07 09:53:09,335 - mmdeploy - INFO - MMCV Compiler: GCC 7.5 2022-02-07 09:53:09,335 - mmdeploy - INFO - MMCV CUDA Compiler: 10.2 2022-02-07 09:53:09,335 - mmdeploy - INFO - MMDeployment: 0.1.0+7a88eae 2022-02-07 09:53:09,908 - mmdeploy - INFO - onnxruntime: None ops_is_avaliable : False 2022-02-07 09:53:09,909 - mmdeploy - INFO - tensorrt: 8.0.1.6 ops_is_avaliable : True 2022-02-07 09:53:09,912 - mmdeploy - INFO - ncnn: None ops_is_avaliable : False 2022-02-07 09:53:09,914 - mmdeploy - INFO - pplnn_is_avaliable: False 2022-02-07 09:53:09,916 - mmdeploy - INFO - openvino_is_avaliable: False
I have used the following deploy command. Model is based on `mask_rcnn_r50` trained with custom dataset.
* deploy command
python MMDeploy/tools/deploy.py \ MMDeploy/configs/mmdet/instance-seg/instance-seg_tensorrt-fp16_dynamic-320x320-1344x1344.py \ mmdetection/work_dirs/mask_rcnn_r50_fpn_1x_coco_768_768_scale4_n1000/mask_rcnn_r50_fpn_1x_coco_logend_batch12_768_768_scale4_n1000.py \ mmdetection/work_dirs/mask_rcnn_r50_fpn_1x_coco_768_768_scale4_n1000/latest.pth \ testdata/testimg1/imageA009.png \ --work-dir mmdeploy_workdir \ --device cuda:0 \ --dump-info
Hi, I tested Mask R-CNN on our Jetson TX2:
NVIDIA Jetson TX2
L4T 32.6.1 [ JetPack 4.6 ]
Ubuntu 18.04.5 LTS
Kernel Version: 4.9.253-tegra
CUDA 10.2.300
CUDA Architecture: 6.2
OpenCV version: 4.1.1
OpenCV Cuda: NO
CUDNN: 8.2.1.32
TensorRT: 8.0.1.6
Vision Works: 1.6.0.501
VPI: ii libnvvpi1 1.1.12 arm64 NVIDIA Vision Programming Interface library
Vulcan: 1.2.70
I used the following command. The checkpoint is downloaded from MMDetection.
python ~/mmdeploy/tools/deploy.py
~/mmdeploy/configs/mmdet/instance-seg/instance-seg_tensorrt_dynamic-320x320-1344x1344.py
/home/pjlab/mmdetection/configs/mask_rcnn/mask_rcnn_r50_caffe_fpn_1x_coco.py
/home/pjlab/mmdetection/checkpoints/mask_rcnn_r50_caffe_fpn_1x_coco_bbox_mAP-0.38__segm_mAP-0.344_20200504_231812-0ebd1859.pth
work_dirs/demo2.jpg
--test-img work_dirs/demo2.jpg
--work-dir work_dirs/output/mmdet-is-trt-8-0/
--device cuda:0
--log-level INFO
The results of PyTorch and TensorRT were identical. I am sorry to say I cannot reproduce the bug.
@SingleZombie I should clarify, that I get identical/correct results on Jetpack 4.6 but not on Jetpack 4.5 so that confirms your results. Both platforms use the same versions of mmdeploy and dependencies. Main difference between Jetpack 4.5/4.6 is TensorRT version so maybe this is the cause of the issue?
NVIDIA Jetson UNKNOWN
L4T 32.6.1 [ JetPack 4.6 ]
Ubuntu 18.04.6 LTS
Kernel Version: 4.9.253-tegra
CUDA 10.2.300
CUDA Architecture: NONE
OpenCV version: 4.1.1
OpenCV Cuda: NO
CUDNN: 8.2.1.32
TensorRT: 8.0.1.6
Vision Works: 1.6.0.501
VPI: ii libnvvpi1 1.1.12 arm64 NVIDIA Vision Programming Interface library
Vulcan: 1.2.70
NVIDIA Jetson UNKNOWN
L4T 32.5.1 [ JetPack 4.5.1 ]
Ubuntu 18.04.6 LTS
Kernel Version: 4.9.201-tegra
CUDA 10.2.89
CUDA Architecture: NONE
OpenCV version: 4.1.1
OpenCV Cuda: NO
CUDNN: 8.0.0.180
TensorRT: 7.1.3.0
Vision Works: 1.6.0.501
VPI: ii libnvvpi1 1.0.15 arm64 NVIDIA Vision Programming Interface library
Vulcan: 1.2.70
Yes, we think the issue is caused by TensorRT 7.1. Thank you for reporting this bug. We don't plan to support TensorRT <= 7.1 now. Maybe we will support it in the future.
@SingleZombie That makes sense. In that case this issue and #114 and PR #133 can probably be closed.
Closing this issue,as TRT7 will not be supported at this point
I have previously used mmdeploy to deploy a model to TensorRT backend using MMDeploy/tools/deploy.py and inference based on the mmdeploy SDK
object_detection.cpp
example.When on the PC, the test output images generated by deploy.py contain identical detections in both pytorch and tensorrt.
However, when I repeat the steps on a Jetson platform, it does not result in identical results. Instead, the detections appear shifted and the masks are distorted. I have used identical mmdeploy configurations for both platforms and identical model input.
I am not sure where to proceed but I suspect there is an incompatibility with the version of tensorrt installed on my Jetson AGX. Before I upgrade to latest Jetpack, I would like to know if you have seen this issue before.