# \[5\] Assertion failed: tensors.count(input\_name)

**URL:** <https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931>\
**Category:** TensorRT\
**Created:** [November 6, 2019, 6:42am UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931 "2019-11-06T06:42:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![562235771](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@562235771](https://forums.developer.nvidia.com/u/562235771)\
**Post date:** [November 6, 2019, 6:42am UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931/1 "2019-11-06T06:42:35Z")

</div>

what does this mean?

* * *

## Input filename: D:\software\TensorRT-6.0.1.5\data\ainno\ts.onnx ONNX IR version: 0.0.4 Opset version: 11 Producer name: pytorch Producer version: 1.3 Domain: Model version: 0 Doc string:

WARNING: ONNX model has a newer ir\_version (0.0.4) than this parser was built against (0.0.3).  
While parsing node number 0 [Conv]:  
ERROR: ModelImporter.cpp:296 In function importModel:  
[5] Assertion failed: tensors.count(input\_name)

---

<div class="post-metadata">

**Author:** ![NVES\_R](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nves_r/32/14043_2.png) [@NVES\_R](https://forums.developer.nvidia.com/u/NVES_R)\
**Post date:** [November 6, 2019, 7:02pm UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931/2 "2019-11-06T19:02:24Z")

</div>

Hi,

I think this error comes from the ONNX parser having an issue parsing your graph, specifically that it found a node with no input I believe.

There are a few things you can try for this:

1. It seems that PyTorch 1.3 is a little more up to date than the current parsers (opset 11), so that may be the root cause for now. You can try downgrading to 1.2 just for exporting your Pytorch to ONNX, see here: [https://github.com/onnx/onnx-tensorrt/issues/302](https://github.com/onnx/onnx-tensorrt/issues/302)

2. You can try inspecting your graph with the ONNX python library to see if it gives you any hints to the issue:

```auto
import onnx
onnx.checker.check_model(onnx_model)

```

1. You can visually inspect your graph using something like [https://lutzroeder.github.io/netron/](https://lutzroeder.github.io/netron/) to see if anything looks wrong with the graph.

2. One user even tried changing the parser code, so there may be some helpful things here, but I don’t think that is necessary: [https://github.com/onnx/onnx-tensorrt/issues/199](https://github.com/onnx/onnx-tensorrt/issues/199)

---

<div class="post-metadata">

**Author:** ![ankit96](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ankit96](https://forums.developer.nvidia.com/u/ankit96)\
**Post date:** [November 7, 2019, 7:44pm UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931/3 "2019-11-07T19:44:29Z")

</div>

@OP I’m also trying to get this to work - I’ll update you. Are you exporting a ResNet-50?

---

<div class="post-metadata">

**Author:** ![ankit96](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ankit96](https://forums.developer.nvidia.com/u/ankit96)\
**Post date:** [November 7, 2019, 9:58pm UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931/4 "2019-11-07T21:58:41Z")

</div>

Update: This works on PyTorch 1.2.0 - downgrading to that should work. However, if you’re looking to do any upsampling op as part of your export to ONNX, you’re going to have some trouble.

---

<div class="post-metadata">

**Author:** ![david.bernstein](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@david.bernstein](https://forums.developer.nvidia.com/u/david.bernstein)\
**Post date:** [July 7, 2020, 7:29pm UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931/5 "2020-07-07T19:29:45Z")

</div>

Any more recent updates on this? I’m seeing the same problem, I need to use pytorch 1.4 for an unrelated reason but building a trt engine from the resulting onnx files fails because of this error.

---

<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, 7:47pm UTC](https://forums.developer.nvidia.com/t/5-assertion-failed-tensors-count-input-name/106931/6 "2021-10-12T19:47:37Z")

</div>


