question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors when using C++ API inference

See original GitHub issue

I don’t know what’s wrong with this computer?cuda or cudnn? Need to get your help.

[2022-07-22 09:47:45.731] [mmdeploy] [error] [trt_net.cpp:28] TRTNet: 3: [executionContext.cpp::nvinfer1::rt::ExecutionContext::setBindingDimensions::926] Error Code 3: API Usage Error (Parameter check failed at: executionContext.cpp::nvinfer1::rt::ExecutionContext::setBindingDimensions::926, condition: mOptimizationProfile >= 0 && mOptimizationProfile < mEngine.getNbOptimizationProfiles()

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
RunningLeoncommented, Jul 22, 2022

@irexyc @lvhan028 Reproduced on my machine

error log with running demo/csrc/object_detection

[2022-07-22 17:00:14.587] [mmdeploy] [info] [model.cpp:95] Register 'DirectoryModel'
[2022-07-22 17:00:14.596] [mmdeploy] [info] [model.cpp:38] DirectoryModel successfully load model /home/PJLAB/maningsheng/projects/openmmlab/mmdeploy/work-dirs/mmdet/yolov3/trt-test
[2022-07-22 17:00:15.701] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: TensorRT was linked against cuBLAS/cuBLAS LT 11.6.3 but loaded cuBLAS/cuBLAS LT 11.2.1
[2022-07-22 17:00:15.983] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: TensorRT was linked against cuDNN 8.2.1 but loaded cuDNN 8.0.5
[2022-07-22 17:00:15.985] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: TensorRT was linked against cuBLAS/cuBLAS LT 11.6.3 but loaded cuBLAS/cuBLAS LT 11.2.1
[2022-07-22 17:00:15.986] [mmdeploy] [warning] [trt_net.cpp:24] TRTNet: TensorRT was linked against cuDNN 8.2.1 but loaded cuDNN 8.0.5
[2022-07-22 17:00:15.990] [mmdeploy] [error] [trt_net.cpp:28] TRTNet: 1: [graphContext.h::MyelinGraphContext::24] Error Code 1: Myelin (Compiled against cuDNN 11.3.0.0 but running against cuDNN 11.2.1.0.)
[2022-07-22 17:00:15.992] [mmdeploy] [error] [trt_net.cpp:28] TRTNet: 1: [graphContext.h::MyelinGraphContext::24] Error Code 1: Myelin (Compiled against cuDNN 11.3.0.0 but running against cuDNN 11.2.1.0.)
[2022-07-22 17:00:16.006] [mmdeploy] [error] [trt_net.cpp:28] TRTNet: 3: [executionContext.cpp::setBindingDimensions::924] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::setBindingDimensions::924, condition: mOptimizationProfile >= 0 && mOptimizationProfile < mEngine.getNbOptimizationProfiles()
)
terminate called after throwing an instance of 'system_error2::status_error<mmdeploy::StatusDomain>'
  what():  unknown (6) @ /home/PJLAB/maningsheng/projects/openmmlab/mmdeploy/csrc/mmdeploy/net/trt/trt_net.cpp:173
Aborted (core dumped)

env

2022-07-22 16:51:11,257 - mmdeploy - INFO - 

2022-07-22 16:51:11,257 - mmdeploy - INFO - **********Environmental information**********
2022-07-22 16:51:12,208 - mmdeploy - INFO - sys.platform: linux
2022-07-22 16:51:12,208 - mmdeploy - INFO - Python: 3.7.5 (default, Oct 25 2019, 15:51:11) [GCC 7.3.0]
2022-07-22 16:51:12,208 - mmdeploy - INFO - CUDA available: True
2022-07-22 16:51:12,208 - mmdeploy - INFO - GPU 0: NVIDIA GeForce RTX 2080
2022-07-22 16:51:12,208 - mmdeploy - INFO - CUDA_HOME: /usr/local/cuda
2022-07-22 16:51:12,208 - mmdeploy - INFO - NVCC: Build cuda_11.1.TC455_06.29069683_0
2022-07-22 16:51:12,208 - mmdeploy - INFO - GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
2022-07-22 16:51:12,208 - mmdeploy - INFO - PyTorch: 1.8.0
2022-07-22 16:51:12,208 - mmdeploy - INFO - PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2021.2-Product Build 20210312 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v1.7.0 (Git Hash 7aed236906b1f7a05c0917e5257a1af05e9ff683)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.1
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=compute_37
  - CuDNN 8.0.5
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -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 -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.8.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

2022-07-22 16:51:12,208 - mmdeploy - INFO - TorchVision: 0.9.0
2022-07-22 16:51:12,208 - mmdeploy - INFO - OpenCV: 4.5.2
2022-07-22 16:51:12,208 - mmdeploy - INFO - MMCV: 1.4.8
2022-07-22 16:51:12,208 - mmdeploy - INFO - MMCV Compiler: GCC 7.3
2022-07-22 16:51:12,208 - mmdeploy - INFO - MMCV CUDA Compiler: 11.1
2022-07-22 16:51:12,208 - mmdeploy - INFO - MMDeploy: 0.6.0+c20bb80
2022-07-22 16:51:12,208 - mmdeploy - INFO - 

2022-07-22 16:51:12,208 - mmdeploy - INFO - **********Backend information**********
2022-07-22 16:51:12,645 - mmdeploy - INFO - onnxruntime: 1.8.0	ops_is_avaliable : True
2022-07-22 16:51:12,663 - mmdeploy - INFO - tensorrt: 8.2.1.8	ops_is_avaliable : True
2022-07-22 16:51:12,678 - mmdeploy - INFO - ncnn: 1.0.20220722	ops_is_avaliable : True
2022-07-22 16:51:12,720 - mmdeploy - INFO - pplnn_is_avaliable: True
2022-07-22 16:51:12,733 - mmdeploy - INFO - openvino_is_avaliable: True
2022-07-22 16:51:12,733 - mmdeploy - INFO - 

2022-07-22 16:51:12,733 - mmdeploy - INFO - **********Codebase information**********
2022-07-22 16:51:14,761 - mmdeploy - INFO - mmdet:	2.25.0
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmseg:	0.26.0
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmcls:	0.23.0
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmocr:	None
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmedit:	0.12.0
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmdet3d:	1.0.0rc3
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmpose:	0.26.0
2022-07-22 16:51:14,762 - mmdeploy - INFO - mmrotate:	0.3.2

script with deploy.py

python tools/deploy.py \
configs/mmdet/detection/detection_tensorrt_dynamic-64x64-608x608.py \
../mmdetection/configs/yolo/yolov3_d53_mstrain-608_273e_coco.py \
https://download.openmmlab.com/mmdetection/v2.0/yolo/yolov3_d53_mstrain-608_273e_coco/yolov3_d53_mstrain-608_273e_coco_20210518_115020-a2c3acb8.pth \
../mmdetection/demo/demo.jpg \
--work-dir ./work-dirs/mmdet/yolov3/trt-test \
--device cuda \
--dump-info \

script with test.py run successfully.

python tools/test.py
configs/mmdet/detection/detection_sdk_dynamic.py \
../mmdetection/configs/yolo/yolov3_d53_mstrain-608_273e_coco.py \
--model ./work-dirs/mmdet/yolov3/trt-test \
--device cuda \
--metrics bbox \

script with object_detection failed

./build/install/example/build/object_detection \
cuda \
./work-dirs/mmdet/yolov3/trt-test \
../mmdetection/demo/demo.jpg
0reactions
RunningLeoncommented, Jul 27, 2022

The pytorch was installed with conda through conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=11.1 -c pytorch Reinstall pytorch with pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html works. Strongly suggest not to install cudatoolkit with conda if cuda&cudnn are already installed on the machine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

APEx: Automated Inference of Error Specifications for C APIs
Using our approach, we generated 93 correct error specifications for API functions collected from 6 popular C libraries, with a pre- cision of...
Read more >
Tensorflow-Lite on NDK with C-API fails to provide output - no ...
Extracting the inference result with TfLiteTensorCopyToBuffer does not change the output array - it's still all zeros. Describe the expected ...
Read more >
Inference error with TensorFlow C++ on iOS: "Invalid argument
I am trying to run my model on iOS using TensorFlow's C++ API. The model is a SavedModel saved ...
Read more >
[OpenVino C API] inference engine error while reading network
Solved: Hi I have converted my ML model using a model optimizer. My project is developed in C language and my model will...
Read more >
Inferencing SDK Error Codes - Edge Impulse API
This occurs if you are using EI_C_LINKAGE to call to SDK from a C file. Some functions are not supported via C linkage....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found