Unable to create trt from etlt file (YOLOV4)

I have trained yolov4 with resnet 18, then etlt file converted successfully, but when i tried to convert etlt to trt, i face error.

Code

!tlt-converter -k $KEY \
               -d 3,240,320 \
               -o BatchedNMS \
               -e $USER_EXPERIMENT_DIR/export/trt.engine \
               -m 4 \
               -t fp32 \
               -i nchw \
               $USER_EXPERIMENT_DIR/export/yolov4_resnet18_epoch_$EPOCH.etlt

Error

[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] UffParser: Parser error: yolo_conv2_bn/batchnorm/mul_1: The input to the Scale Layer is required to have a minimum of 3 dimensions.
[ERROR] Failed to parse the model, please check the encoding key to make sure it’s correct
[ERROR] Network must have at least one output
[ERROR] Network validation failed.
[ERROR] Unable to create engine
Segmentation fault (core dumped)

I know, from this we can say that key is incorrect, but i checked inference with that key, its working fine.

Several questions here.

  • Did you run with 3.0-py3 or 3.0-dp-py3 ?
  • Can you run below command and share the result?
    ! tlt yolo_v4 run ls -l $USER_EXPERIMENT_DIR/export/yolov4_resnet18_epoch_$EPOCH.etlt

Yes, the Transfer learning toolkit is 3.0,
The result of command !tlt yolo_v4 run ls -l $USER_EXPERIMENT_DIR/export/yolov4_resnet18_epoch_$EPOCH.etlt

Result
/bin/sh: 1: tlt: not found

Also, please recheck my question, I just edited

Please add "-p " . You can download latest jupyter notebook(TLT Quick Start Guide — Transfer Learning Toolkit 3.0 documentation) for reference.
See YOLOv4 — Transfer Learning Toolkit 3.0 documentation too.

!tlt tlt-converter -k $KEY \
                   -p Input,1x3x384x1248,8x3x384x1248,16x3x384x1248 \
                   -e $USER_EXPERIMENT_DIR/export/trt.engine \
                   -t fp32 \
                   $USER_EXPERIMENT_DIR/export/yolov4_resnet18_epoch_$EPOCH.etlt

After running command.

"!tlt tlt-converter -k $KEY \\\n",
"                   -p Input,1x3x384x1248,8x3x384x1248,16x3x384x1248 \\\n",
"                   -e $USER_EXPERIMENT_DIR/export/trt.engine \\\n",
"                   -t fp32 \\\n",
"                   $USER_EXPERIMENT_DIR/export/yolov4_resnet18_epoch_$EPOCH.etlt\n",

Error
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] encoded_bg/concat: all concat input tensors must have the same dimensions except on the concatenation axis (1), but dimensions mismatched at index 0. Input 0 shape: [210,6,1], Input 1 shape: [240,6,1]
[ERROR] UffParser: Parser error: yolo_conv2_bn/batchnorm/mul_1: The input to the Scale Layer is required to have a minimum of 3 dimensions.
[ERROR] Failed to parse the model, please check the encoding key to make sure it’s correct
[ERROR] Network must have at least one output
[ERROR] Network validation failed.
[ERROR] Unable to create engine
Segmentation fault (core dumped)

Can you share your training spec? What is the input size of the yolo_v4 model?

Thanks @Morganh. The issue is related to input size. Thanks for your support.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.