Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT8 Calibration error in YOLOV8 with Tensorrt7.1 #603

Open
tms2003 opened this issue Dec 12, 2024 · 2 comments
Open

INT8 Calibration error in YOLOV8 with Tensorrt7.1 #603

tms2003 opened this issue Dec 12, 2024 · 2 comments

Comments

@tms2003
Copy link

tms2003 commented Dec 12, 2024

WARNING: [TRT]: Calibration Profile is not defined. Calibrating with Profile 0I use deepstream 7.1 to perform yolov8 fp32 and fp16 reasoning normally, but an error occurs when int8 reasoning:


root@myai:export INT8_CALIB_IMG_PATH=/data/DeepStream-Yolo/calibration.txt
root@myai:/data/DeepStream-Yolo# export INT8_CALIB_BATCH_SIZE=4


root@myai:/data/DeepStream-Yolo# deepstream-app -c deepstream_app_config.txt 

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test ***

Failed to query video capabilities: Invalid argument
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:1152 Deserialize engine failed because file path: /data/DeepStream-Yolo/model_b4_gpu0_int8.engine open error
0:00:00.201818454   603 0x593cf8dffe60 WARN                 nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2080> [UID = 1]: deserialize engine from file :/data/DeepStream-Yolo/model_b4_gpu0_int8.engine failed
0:00:00.201856666   603 0x593cf8dffe60 WARN                 nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2185> [UID = 1]: deserialize backend context from engine from file :/data/DeepStream-Yolo/model_b4_gpu0_int8.engine failed, try rebuild
0:00:00.201867746   603 0x593cf8dffe60 INFO                 nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2106> [UID = 1]: Trying to create engine from model files
WARNING: ../nvdsinfer/nvdsinfer_model_builder.cpp:382 INT8 calibration file not specified/accessible. INT8 calibration can be done through setDynamicRange API in 'NvDsInferCreateNetwork' implementation

Building the TensorRT Engine


File does not exist: /data/DeepStream-Yolo/calib.table
WARNING: [TRT]: Calibration Profile is not defined. Calibrating with Profile 0
ERROR: [TRT]: [checkSanity.cpp::checkLinks::218] Error Code 2: Internal Error (Assertion item.second != nullptr failed. region should have been removed from Graph::regions)
Segmentation fault (core dumped)

My configuration code is as follows:

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
onnx-file=/data/weights/yolov8_1280_c11.pt.onnx
model-engine-file=model_b4_gpu0_int8.engine
int8-calib-file=calib.table
labelfile-path=c11.txt
batch-size=4
#0=FP32, 1=INT8, 2=FP16 mode
network-mode=1
num-detected-classes=11
interval=0
gie-unique-id=1
process-mode=1
network-type=0
cluster-mode=2
maintain-aspect-ratio=1
symmetric-padding=1
#workspace-size=2000
parse-bbox-func-name=NvDsInferParseYolo
#parse-bbox-func-name=NvDsInferParseYoloCuda
custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300

I use the latest nvidia official docker image.
NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6.
The hardware is RTX 4070ti super.

@LJ-Hao
Copy link

LJ-Hao commented Jan 6, 2025

The same error with Nvidia Jetson Orin Nano.

@jcgassoloncan
Copy link

Hi, I think it is related with this #585 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants