# Failed to create .engine File

**URL:** <https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454>\
**Category:** TAO Toolkit\
**Created:** [June 3, 2022, 2:24pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454 "2022-06-03T14:24:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 3, 2022, 2:24pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/1 "2022-06-03T14:24:18Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)** : Jetson Xavier NX  
**• DeepStream Version** :6 .0  
**• JetPack Version (valid for Jetson only)** : Jetpack 4.6 (32.6.1)  
**• TensorRT Version** : 8.0.6.1  
**• Issue Type( questions, new requirements, bugs)** - Question

Hello Everyone,  
I have a deepstream application with 4 input video file sources. In the pgie\_config.txt file, I am using an efficientdet0 model. When I set the batch size to 1, the engine file is created successfully. However, when I put the batch size to 4 it fails to create the engine file and gives the following error:

```auto
ERROR: [TRT]: 4: [shapeCompiler.cpp::evaluateShapeChecks::822] 
Error Code 4: Internal Error (kOPT values for profile 0 violate shape constraints: reshape would change volume. IShuffleLayer block1a_se_squeeze/Mean_Squeeze__3549: reshaping failed for tensor: block1a_se_squeeze/Mean:0)
ERROR: Build engine failed from config file
Segmentation fault

```

Following is my pgie\_config.txt file:

```auto
[property]
labelfile-path= ../../models/people_net_model/labels.txt
enable-dla=0
use-dla-core=0
infer-dims=3;544;960
gpu-id=0
gie-unique-id=1
model-color-format=0
network-mode=1 ## 0=FP32, 1=INT8, 2=FP16 mode
maintain-aspect-ratio=1
#batch-size=1
network-input-order=1
net-scale-factor=1.0
offsets=0;0;0
is-classifier=0
cluster-mode=4      

int8-calib-file=../../models/people_net_model/efficientdet_d0.cal
tlt-encoded-model = ../../models/people_net_model/det0_int8.etlt

tlt-model-key=nvidia_tlt
uff-input-blob-name=image_arrays:0
output-blob-names=num_detections;detection_boxes;detection_scores;detection_classes
parse-bbox-func-name=NvDsInferParseCustomEfficientDetTAO
custom-lib-path = /home/nvidia/deepstream_tao_apps/post_processor/libnvds_infercustomparser_tao.so
num-detected-classes=1
interval=2

[class-attrs-all]
pre-cluster-threshold=0.15
roi-top-offset=0
roi-bottom-offset=0
detected-min-w=0
detected-min-h=0
detected-max-w=0
detected-max-h=0

```

Can you tell me how to create the engine file for 4 or more sources?

Looking forward to your replies

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [June 6, 2022, 8:13am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/3 "2022-06-06T08:13:54Z")

</div>

The pretrained model’s max batch size is 1. Please re-train the model with bigger batch size. [EfficientDet — TAO Toolkit 3.22.05 documentation (nvidia.com)](https://docs.nvidia.com/tao/tao-toolkit/text/object_detection/efficientdet.html#efficientdet)

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 6, 2022, 4:50pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/4 "2022-06-06T16:50:52Z")

</div>

Hello @Fiona.Chen,  
Thank you for your reply. Can you tell me how to specify this max batch size while training?  
I was not able to find the option.

I am looking forward to your reply.

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [June 7, 2022, 2:15am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/5 "2022-06-07T02:15:03Z")

</div>

@Morganh Can you help @anshul12256 to figure out how to modify the batch size of efficientdet0?

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 7, 2022, 2:28am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/6 "2022-06-07T02:28:06Z")

</div>

@anshul12256  
User can set `train_batch_size` during training. See [EfficientDet — TAO Toolkit 3.22.05 documentation](https://docs.nvidia.com/tao/tao-toolkit/text/object_detection/efficientdet.html#training-config)

But it does not make sense when you “put the batch size to 4 it fails to create the engine file and gives the following error” . Please share the full command and full log.

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 7, 2022, 2:42am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/7 "2022-06-07T02:42:23Z")

</div>

Moving to TAO forum.

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 7, 2022, 7:09am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/9 "2022-06-07T07:09:02Z")

</div>

Hello @Morganh,  
The train\_batch\_size parameter is used to set the batch size of the training dataset for training the model.  
I want to create an engine file from the .etlt model file for 4 input sources.  
These are two different things.  
In my pgie\_config file, I set the path to the etlt model and when I launch my deepstream application I get the following messages on the terminal

```auto
nvidia@nvidia-desktop:~/embeddedvision$ ./embedded_vision
PIPELINE 1 = streammux -> pgie -> nvtracker -> tiler -> nvosd
nvosd -> tee
tee -> output_sink_bin
greenMenu
Get Video Handle
Starting...

Using winsys: x11
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-6.0/lib/libnvds_nvmultiobjecttracker.so
~~ CLOG[/dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/NvTrackerParams.hpp, getConfigRoot() @line 54]: [NvTrackerParams::getConfigRoot()] !!![WARNING] Invalid low-level config file caused an exception, but will go ahead with the default config values
gstnvtracker: Batch processing is ON
gstnvtracker: Past frame output is ON
~~ CLOG[/dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/NvTrackerParams.hpp, getConfigRoot() @line 54]: [NvTrackerParams::getConfigRoot()] !!![WARNING] Invalid low-level config file caused an exception, but will go ahead with the default config values
[NvMultiObjectTracker] Initialized
0:00:00.756406906 29730 0x5597d72c90 INFO nvinfer gstnvinfer.cpp:638:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
WARNING: [TRT]: onnx2trt_utils.cpp:364: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
WARNING: [TRT]: DLA requests all profiles have same min, max, and opt value. All dla layers are falling back to GPU
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 97) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 208) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 211) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 309) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 312) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 316) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 319) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 326) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 333) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 339) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 351) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 356) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 362) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 374) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 379) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 385) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 397) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 402) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 408) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 420) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 423) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 430) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 442) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 445) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 448) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 456) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 468) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 471) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 474) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 482) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 494) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 497) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 500) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 508) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 520) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 525) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 531) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 543) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 548) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 554) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 566) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 571) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 577) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 589) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 594) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 600) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 612) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 615) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 622) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 634) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 637) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 640) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 648) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 660) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 663) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 666) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 674) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 686) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 689) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 692) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 700) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 712) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 717) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 723) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 735) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 740) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 746) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 758) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 763) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 769) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 781) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 786) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 792) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 807) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 821) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 854) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 876) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 909) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 931) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 964) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Missing scale and zero-point for tensor (Unnamed Layer* 986) [Constant]_output, expect fall back to non-int8 implementation for any layer consuming or producing given tensor
WARNING: [TRT]: Detected invalid timing cache, setup a local cache instead
ERROR: [TRT]: 4: [shapeCompiler.cpp::evaluateShapeChecks::822] Error Code 4: Internal Error (kOPT values for profile 0 violate shape constraints: reshape would change volume. IShuffleLayer block1a_se_squeeze/Mean_Squeeze__3549: reshaping failed for tensor: block1a_se_squeeze/Mean:0)
ERROR: Build engine failed from config file
Segmentation fault

```

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 7, 2022, 7:42am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/10 "2022-06-07T07:42:16Z")

</div>

> [@anshul12256](#):
>
> `$ ./embedded_vision`

What is the “embedded\_vision”?

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 7, 2022, 7:50am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/11 "2022-06-07T07:50:14Z")

</div>

Hello @Morganh,  
That is the name of my deepstream application.

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 7, 2022, 8:19am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/12 "2022-06-07T08:19:39Z")

</div>

Could you please try default official deepstream application?

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 8, 2022, 3:46pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/13 "2022-06-08T15:46:07Z")

</div>

Hello @Morganh, I tried the default official tao application but even that worked with only a batch size of 1. However, I solved the problem by using the following command in the efficientdet jupyter notebook

```auto
!mkdir -p $LOCAL_EXPERIMENT_DIR/export_int8
# Uncomment to remove existing etlt file
# !rm $LOCAL_EXPERIMENT_DIR/experiment_dir_retrain/model.step-0.etlt
!tao efficientdet export -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.tlt \
                         -o $USER_EXPERIMENT_DIR/experiment_dir_retrain/model_int8.step-$NUM_STEP.etlt \
                         -k $KEY \
                         -e $SPECS_DIR/efficientdet_d1_retrain.txt \
                         --batch_size 4 \
                         --data_type int8 \
                         --cal_image_dir $DATA_DOWNLOAD_DIR/training_v6_coco_crowd/images_testing \
                         --batches 10 \
                         --max_batch_size 4 \
                         --cal_cache_file $USER_EXPERIMENT_DIR/export_int8/efficientdet_d0.cal

```

Here the max\_batch\_size parameter enabled to create the .etlt model with a batch size of 4.

However, now I have another question.  
When I provided the above .etlt model with a batch size of 4 in the pgie\_config.txt file, the resulting engine file created by the system is of 27.2 MB. My .etlt model is 9.3 MB. Since the engine file is huge, I get very poor performance (6-15 FPS) for 4 streams.

To verify this, I also used the tao-converter on the XNX with the following command:

```auto
./tao-converter -k nvidia_tlt -d 544,960,3 -c /home/nvidia/embeddedvision/models/people_net_model/efficientdet_d2.cal -m 4 -t int8 /home/nvidia/embeddedvision/models/people_net_model/model_int8.step-562500.etlt

```

The resulting engine file created is also around the same size of 26.2 MB.

I would like to know why the int8 engine is nearly 3X bigger than the model?

Because when I used detectnetv2 with resnet34 as the backbone architecture the etlt model was 10.4 MB and the resulting int8 engine file was 5.8 MB

Looking forward to your response

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 13, 2022, 8:22am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/14 "2022-06-13T08:22:17Z")

</div>

Hello @Morganh,  
Would like to ask, were you able to get the solution to the above question?

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 13, 2022, 10:08am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/15 "2022-06-13T10:08:24Z")

</div>

> [@anshul12256](#):
>
> the resulting engine file created by the system is of 27.2 MB. My .etlt model is 9.3 MB. Since the engine file is huge, I get very poor performance (6-15 FPS) for 4 streams.

How about the fp16 engine’s size and its fps?  
More, usually, the fps is related to trainable parameters.

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 13, 2022, 1:12pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/16 "2022-06-13T13:12:58Z")

</div>

Hello @Morganh,  
For the FP16 the engine size was 19.3 MB with 17-20 FPS for 1 stream. I couldn’t check for 4 streams because I had exported the model with a max batch size of 1.

I find this a bit surprising that an FP16 engine is smaller than an INT8 engine!

Would like to know your opinion !!

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 13, 2022, 1:27pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/17 "2022-06-13T13:27:44Z")

</div>

I need to reproduce firstly.

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 13, 2022, 1:31pm UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/18 "2022-06-13T13:31:38Z")

</div>

Hi @Morganh,  
Thanks for your reply. Looking forward to your findings !!  
I am using efficientdet-d2 as the model name and b2 as the backbone architecture.

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 15, 2022, 9:20am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/19 "2022-06-15T09:20:45Z")

</div>

> [@anshul12256](#):
>
> 4 streams

How did you run against 4 streams? Can you share the steps?

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 15, 2022, 9:43am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/20 "2022-06-15T09:43:30Z")

</div>

Hello @Morganh,  
For int8 i had exported the etlt model with a batch size of 4 using the command in the earlier post.  
For fp16 there should be a parameter I suppose which would help to export the etlt model with a batch size of 4

For running on 4 Streams, I have a custom deepstream application. Its pipeline is as follows

```auto
filesrc(source=0, .mp4) -> qtdemux -> h264parse -> nvv4l2decoder -> videorate -> capsfilter(caps=video/x-raw(memory:NVMM)) -> nvvideoconvert -> capsfilter(caps=video/x-raw(memory:NVMM), format=(string)RGBA) -> nvstreammux
filesrc(source=1, .mp4) -> qtdemux -> h264parse -> nvv4l2decoder -> videorate -> capsfilter(caps=video/x-raw(memory:NVMM)) -> nvvideoconvert -> capsfilter(caps=video/x-raw(memory:NVMM), format=(string)RGBA) -> nvstreammux
filesrc(source=2, .mp4) -> qtdemux -> h264parse -> nvv4l2decoder -> videorate -> capsfilter(caps=video/x-raw(memory:NVMM)) -> nvvideoconvert -> capsfilter(caps=video/x-raw(memory:NVMM), format=(string)RGBA) -> nvstreammux
filesrc(source=3, .mp4) -> qtdemux -> h264parse -> nvv4l2decoder -> videorate -> capsfilter(caps=video/x-raw(memory:NVMM)) -> nvvideoconvert -> capsfilter(caps=video/x-raw(memory:NVMM), format=(string)RGBA) -> nvstreammux
nvstreammux -> nvinfer -> nvmultistreamtiler -> nvdsosd -> nvegltransform -> nveglglessink

```

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [June 15, 2022, 10:38am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/21 "2022-06-15T10:38:37Z")

</div>

> [@anshul12256](#):
>
> I find this a bit surprising that an FP16 engine is smaller than an INT8 engine!

I cannot reproduce the result official .etlt file and cal file.

> $ ./tao-converter -k nvidia\_tlt -d 544,960,3 d0\_avlp\_544\_960.etlt -t fp16 -e fp16.engine
> 
> $ ./tao-converter -k nvidia\_tlt -d 544,960,3 d0\_avlp\_544\_960.etlt -t int8 -c d0\_avlp\_544\_960.cal -e int8.engine

Or login 22.05 tf15.5 docker,

> `#` converter -k nvidia\_tlt -d 544,960,3 d0\_avlp\_544\_960.etlt -t int8 -c d0\_avlp\_544\_960.cal -e int8.engine

> `#` converter -k nvidia\_tlt -d 544,960,3 d0\_avlp\_544\_960.etlt -t fp16 -e fp16.engine

Actually you can focus on the pruning ratio. For better fps, please prune to a smaller one and retrain it.

---

<div class="post-metadata">

**Author:** ![anshul12256](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/anshul12256/32/109191_2.png) [@anshul12256](https://forums.developer.nvidia.com/u/anshul12256)\
**Post date:** [June 15, 2022, 10:44am UTC](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454/22 "2022-06-15T10:44:27Z")

</div>

Hello @Morganh,  
what are the sizes of the engine file that you created from the official etlt model ?

[Next page](https://forums.developer.nvidia.com/t/failed-to-create-engine-file/216454.md?page=2)
