# Onnx implicit batch dimension

**URL:** <https://forums.developer.nvidia.com/t/onnx-implicit-batch-dimension/125165>\
**Category:** DeepStream SDK\
**Created:** [May 28, 2020, 6:09am UTC](https://forums.developer.nvidia.com/t/onnx-implicit-batch-dimension/125165 "2020-05-28T06:09:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sherlocking](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sherlocking/32/15573_2.png) [@sherlocking](https://forums.developer.nvidia.com/u/sherlocking)\
**Post date:** [May 28, 2020, 6:09am UTC](https://forums.developer.nvidia.com/t/onnx-implicit-batch-dimension/125165/1 "2020-05-28T06:09:30Z")

</div>

Please provide complete information as applicable to your setup.

## **• Hardware Platform: GPU**  **• DeepStream Version: 5.0** **• JetPack Version (valid for Jetson only)**  **• TensorRT Version: 7.0** \*\*• NVIDIA GPU Driver Version:440.64 \*\* I used a custom onnx classification model as primary engine. However I got an error about implicit batch dimension:

## Input filename: /opt/nvidia/deepstream/deepstream-5.0/sources/fire\_detect/model.onnx ONNX IR version: 0.0.4 Opset version: 8 Producer name: tf2onnx Producer version: 1.5.6 Domain: Model version: 0 Doc string:

ERROR: ModelImporter.cpp:457 In function importModel:  
[4] Assertion failed: !\_importer\_ctx.network()-\>hasImplicitBatchDimension() && “This version of the ONNX parser only supports TensorRT INetworkDefinitions with an explicit batch dimension. Please ensure the network was created using the EXPLICIT\_BATCH NetworkDefinitionCreationFlag.”  
ERROR: ../nvdsinfer/nvdsinfer\_model\_builder.cpp:390 Failed to parse onnx file  
ERROR: ../nvdsinfer/nvdsinfer\_model\_builder.cpp:971 failed to build network since parsing model errors.  
ERROR: ../nvdsinfer/nvdsinfer\_model\_builder.cpp:872 failed to build network.

[models/model.onnx at master · sherlockking/models · GitHub](https://github.com/sherlockking/models/blob/master/model.onnx) is the model I used

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [May 28, 2020, 8:07am UTC](https://forums.developer.nvidia.com/t/onnx-implicit-batch-dimension/125165/3 "2020-05-28T08:07:16Z")

</div>

Hi,

Could you find if this suggestion works for you first?

> <https://github.com/onnx/onnx-tensorrt/issues/266#issuecomment-567319883>
>
> Hi, I built with the latest TensorRT master branch and got the following error m…essage when running \`python onnx\_backend\_test.py OnnxBackendRealModelTest\` and the sample code
> 
> \> \[4\] Assertion failed: !\_importer\_ctx.network()-\>hasImplicitBatchDimension() && "This version of the ONNX parser only supports networks with an explicit batch dimension"
> \> 
> \> ----------------------------------------------------------------------
> \> Ran 18 tests in 5.622s
> \> 
> \> FAILED (errors=9, skipped=9)
> \> 
> 
> How should I solve this? 
> 
> My versions are tensorrt-6.0.1.5 and cuda 10.1
> 
> Thanks!

Thanks.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:17pm UTC](https://forums.developer.nvidia.com/t/onnx-implicit-batch-dimension/125165/5 "2021-10-12T16:17:43Z")

</div>

Closed on October 12, 2021, 4:17pm UTC


