DeepStream-Yolo: what is "Assertion `0' failed." Error ?

Ihaven’t been able to solve this problem for 2 months … please help

deepstream-app -c deepstream_app_config.txt

Using winsys: x11 ERROR: Deserialize engine failed because file path: /home/iisl/Desktop/deepstream-6.0/sources/DeepStream-Yolo-master/model_b1_gpu0_fp32.engine open error 0:00:04.043230373 9789 0x2d12ae40 WARN nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1889> [UID = 1]: deserialize engine from file :/home/iisl/Desktop/deepstream-6.0/sources/DeepStream-Yolo-master/model_b1_gpu0_fp32.engine failed 0:00:04.043411262 9789 0x2d12ae40 WARN nvinfer gstnvinfer.cpp:635:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1996> [UID = 1]: deserialize backend context from engine from file :/home/iisl/Desktop/deepstream-6.0/sources/DeepStream-Yolo-master/model_b1_gpu0_fp32.engine failed, try rebuild 0:00:04.043444232 9789 0x2d12ae40 INFO nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files

Loading pre-trained weights Loading weights of yolov5n complete Total weights read: 5256618 Building YOLO network

  layer                        input               output         weightPtr

(0) conv_silu 3 x 640 x 640 16 x 320 x 320 1792
(1) conv_silu 16 x 320 x 320 32 x 160 x 160 6528
(2) conv_silu 32 x 160 x 160 16 x 160 x 160 7104
(3) route - 32 x 160 x 160 7104
(4) conv_silu 32 x 160 x 160 16 x 160 x 160 7680
(5) conv_silu 16 x 160 x 160 16 x 160 x 160 8000
(6) conv_silu 16 x 160 x 160 16 x 160 x 160 10368
(7) shortcut_linear: 4 - 16 x 160 x 160 -
(8) route - 32 x 160 x 160 10368
(9) conv_silu 32 x 160 x 160 32 x 160 x 160 11520
(10) conv_silu 32 x 160 x 160 64 x 80 x 80 30208
(11) conv_silu 64 x 80 x 80 32 x 80 x 80 32384
(12) route - 64 x 80 x 80 32384
(13) conv_silu 64 x 80 x 80 32 x 80 x 80 34560
(14) conv_silu 32 x 80 x 80 32 x 80 x 80 35712
(15) conv_silu 32 x 80 x 80 32 x 80 x 80 45056
(16) shortcut_linear: 13 - 32 x 80 x 80 -
(17) conv_silu 32 x 80 x 80 32 x 80 x 80 46208
(18) conv_silu 32 x 80 x 80 32 x 80 x 80 55552
(19) shortcut_linear: 16 - 32 x 80 x 80 -
(20) route - 64 x 80 x 80 55552
(21) conv_silu 64 x 80 x 80 64 x 80 x 80 59904
(22) conv_silu 64 x 80 x 80 128 x 40 x 40 134144 (23) conv_silu 128 x 40 x 40 64 x 40 x 40 142592 (24) route - 128 x 40 x 40 142592 (25) conv_silu 128 x 40 x 40 64 x 40 x 40 151040 (26) conv_silu 64 x 40 x 40 64 x 40 x 40 155392 (27) conv_silu 64 x 40 x 40 64 x 40 x 40 192512 (28) shortcut_linear: 25 - 64 x 40 x 40 -
(29) conv_silu 64 x 40 x 40 64 x 40 x 40 196864 (30) conv_silu 64 x 40 x 40 64 x 40 x 40 233984 (31) shortcut_linear: 28 - 64 x 40 x 40 -
(32) conv_silu 64 x 40 x 40 64 x 40 x 40 238336 (33) conv_silu 64 x 40 x 40 64 x 40 x 40 275456 (34) shortcut_linear: 31 - 64 x 40 x 40 -
(35) route - 128 x 40 x 40 275456 (36) conv_silu 128 x 40 x 40 128 x 40 x 40 292352 (37) conv_silu 128 x 40 x 40 192 x 20 x 20 514304 (38) conv_silu 192 x 20 x 20 96 x 20 x 20 533120 (39) route - 192 x 20 x 20 533120 (40) conv_silu 192 x 20 x 20 96 x 20 x 20 551936 (41) conv_silu 96 x 20 x 20 96 x 20 x 20 561536 (42) conv_silu 96 x 20 x 20 96 x 20 x 20 644864 (43) shortcut_linear: 40 - 96 x 20 x 20 -
(44) route - 192 x 20 x 20 644864 (45) conv_silu 192 x 20 x 20 192 x 20 x 20 682496 (46) conv_silu 192 x 20 x 20 256 x 10 x 10 1125888 (47) conv_silu 256 x 10 x 10 128 x 10 x 10 1159168 (48) route - 256 x 10 x 10 1159168 (49) conv_silu 256 x 10 x 10 128 x 10 x 10 1192448 (50) conv_silu 128 x 10 x 10 128 x 10 x 10 1209344 (51) conv_silu 128 x 10 x 10 128 x 10 x 10 1357312 (52) shortcut_linear: 49 - 128 x 10 x 10 -
(53) route - 256 x 10 x 10 1357312 (54) conv_silu 256 x 10 x 10 256 x 10 x 10 1423872 (55) conv_silu 256 x 10 x 10 128 x 10 x 10 1457152 (56) maxpool 128 x 10 x 10 128 x 10 x 10 1457152 (57) maxpool 128 x 10 x 10 128 x 10 x 10 1457152 (58) maxpool 128 x 10 x 10 128 x 10 x 10 1457152 (59) route - 512 x 10 x 10 1457152 (60) conv_silu 512 x 10 x 10 256 x 10 x 10 1589248 (61) conv_silu 256 x 10 x 10 192 x 10 x 10 1639168 (62) upsample 192 x 10 x 10 192 x 20 x 20 -
(63) route - 384 x 20 x 20 1639168 (64) conv_silu 384 x 20 x 20 96 x 20 x 20 1676416 (65) route - 384 x 20 x 20 1676416 (66) conv_silu 384 x 20 x 20 96 x 20 x 20 1713664 (67) conv_silu 96 x 20 x 20 96 x 20 x 20 1723264 (68) conv_silu 96 x 20 x 20 96 x 20 x 20 1806592 (69) route - 192 x 20 x 20 1806592 (70) conv_silu 192 x 20 x 20 192 x 20 x 20 1844224 (71) conv_silu 192 x 20 x 20 128 x 20 x 20 1869312 (72) upsample 128 x 20 x 20 128 x 40 x 40 -
(73) route - 256 x 40 x 40 1869312 (74) conv_silu 256 x 40 x 40 64 x 40 x 40 1885952 (75) route - 256 x 40 x 40 1885952 (76) conv_silu 256 x 40 x 40 64 x 40 x 40 1902592 (77) conv_silu 64 x 40 x 40 64 x 40 x 40 1906944 (78) conv_silu 64 x 40 x 40 64 x 40 x 40 1944064 (79) route - 128 x 40 x 40 1944064 (80) conv_silu 128 x 40 x 40 128 x 40 x 40 1960960 (81) conv_silu 128 x 40 x 40 64 x 40 x 40 1969408 (82) upsample 64 x 40 x 40 64 x 80 x 80 -
(83) route - 128 x 80 x 80 1969408 (84) conv_silu 128 x 80 x 80 32 x 80 x 80 1973632 (85) route - 128 x 80 x 80 1973632 (86) conv_silu 128 x 80 x 80 32 x 80 x 80 1977856 (87) conv_silu 32 x 80 x 80 32 x 80 x 80 1979008 (88) conv_silu 32 x 80 x 80 32 x 80 x 80 1988352 (89) route - 64 x 80 x 80 1988352 (90) conv_silu 64 x 80 x 80 64 x 80 x 80 1992704 (91) conv_silu 64 x 80 x 80 64 x 40 x 40 2029824 (92) route - 128 x 40 x 40 2029824 (93) conv_silu 128 x 40 x 40 64 x 40 x 40 2038272 (94) route - 128 x 40 x 40 2038272 (95) conv_silu 128 x 40 x 40 64 x 40 x 40 2046720 (96) conv_silu 64 x 40 x 40 64 x 40 x 40 2051072 (97) conv_silu 64 x 40 x 40 64 x 40 x 40 2088192 (98) route - 128 x 40 x 40 2088192 (99) conv_silu 128 x 40 x 40 128 x 40 x 40 2105088 (100) conv_silu 128 x 40 x 40 128 x 20 x 20 2253056 (101) route - 256 x 20 x 20 2253056 (102) conv_silu 256 x 20 x 20 96 x 20 x 20 2278016 (103) route - 256 x 20 x 20 2278016 (104) conv_silu 256 x 20 x 20 96 x 20 x 20 2302976 (105) conv_silu 96 x 20 x 20 96 x 20 x 20 2312576 (106) conv_silu 96 x 20 x 20 96 x 20 x 20 2395904 (107) route - 192 x 20 x 20 2395904 (108) conv_silu 192 x 20 x 20 192 x 20 x 20 2433536 (109) conv_silu 192 x 20 x 20 192 x 10 x 10 2766080 (110) route - 384 x 10 x 10 2766080 (111) conv_silu 384 x 10 x 10 128 x 10 x 10 2815744 (112) route - 384 x 10 x 10 2815744 (113) conv_silu 384 x 10 x 10 128 x 10 x 10 2865408 (114) conv_silu 128 x 10 x 10 128 x 10 x 10 2882304 (115) conv_silu 128 x 10 x 10 128 x 10 x 10 3030272 (116) route - 256 x 10 x 10 3030272 (117) conv_silu 256 x 10 x 10 256 x 10 x 10 3096832 (118) route - 64 x 80 x 80 3096832 (119) conv_logistic 64 x 80 x 80 255 x 80 x 80 3113407 (120) yolo 255 x 80 x 80 255 x 80 x 80 3113407 (121) route - 128 x 40 x 40 3113407 (122) conv_logistic 128 x 40 x 40 255 x 40 x 40 3146302 (123) yolo 255 x 40 x 40 255 x 40 x 40 3146302 (124) route - 192 x 20 x 20 3146302 (125) conv_logistic 192 x 20 x 20 255 x 20 x 20 3195517 (126) yolo 255 x 20 x 20 255 x 20 x 20 3195517 (127) route - 256 x 10 x 10 3195517 (128) conv_logistic 256 x 10 x 10 255 x 10 x 10 3261052 (129) yolo 255 x 10 x 10 255 x 10 x 10 3261052 Number of unused weights left: 1995566 deepstream-app: yolo.cpp:422: NvDsInferStatus Yolo::buildYoloNetwork(std::vector<float>&, nvinfer1::INetworkDefinition&): Assertion `0’ failed. Aborted (core dumped)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 47 (19 by maintainers)

Most upvoted comments

The issue was fixed. I was using the yolov5s.yaml file in /models but in /models/hub there was a yolov5s6.yaml, my issue was fixed after I used that yaml.

@Krokos11, the yaml file should be one of them (according to your model): https://github.com/ultralytics/yolov5/tree/master/models

@indraksha, you need to use the yaml file of the YOLOv5 5.0 version. You are trying to use the yaml of the YOLOv5 6.1. Try to run git checkout v5.0 before convert the model.

Thanks, it worked

@indraksha, It’s already supported.

It’s working now.

I also double checked the correct v6.0 yolo version.

Is your model trained in YOLOv5 6.0 / 6.1 version?

I made an error, even though I pulled the latest repo version, the downloaded pretrained checkpoint was still on v5.0 version, so I was loading the old v5.0 model when training.

Now it is working perfectly, thank you for the amazing work!