Onnx-tensorrt: Assertion failed: ctx->tensors().count(inputName)

Created on 16 Mar 2020  路  12Comments  路  Source: onnx/onnx-tensorrt

When I convert onnx file to trt engine, but got this error below:
while parsing node number 224 [Resize]:
Assertion failed: cxt->tensors().count(inputName)
When I use onnxsim to simplify onnx to merge constant node, but i got this error below:
In node-1 (parseGraph): unsupported _node: Assertion failed: convertOnnxWeights(initialize, &weights, ctx)

version:

  • trt 7.0
  • onnx 1.6.0
  • pytorch 1.4
bug triaged

Most helpful comment

i have solved it.
just recompile the newest onnx lib and set opset=11 in trt7. hope it works

All 12 comments

I have the same problem.

While parsing node number 362 [Resize]:
ERROR: ModelImporter.cpp:124 In function parseGraph:
[5] Assertion failed: ctx->tensors().count(inputName)

When i visiualized onnx model by netron, it seem have a constant op before resize op

Did you solve this problem? I met the same error.
trt 7.0
pytorch 1.4.0
interpolate mode: bilinear

i have solved it.
just recompile the newest onnx lib and set opset=11 in trt7. hope it works

i have solved it.
just recompile the newest onnx lib and set opset=11 in trt7. hope it works

I have the same problem, what's the onnx lib name that your replace? thanks

Hi, @Syencil .
same problem faced when I tried to convert a onnx model into trt engine using trtexec.exe.
Could you tell me more details for solving this problem, as I can not find any onnx lib. Do you mean nvonnxparser.dll or nvparsers.dll (windows pakage download from nvidia website) ?

Any suggestion is appreciated, tks!

Input filename: 1.onnx
ONNX IR version: 0.0.6
Opset version: 11
Producer name: pytorch
Producer version: 1.5
cuda 10.2
cudnn 7.6

tensorrt 7.0.1

While parsing node number 169 [Resize]:
ERROR: ModelImporter.cpp:124 In function parseGraph:
[5] Assertion failed: ctx->tensors().count(inputName)
[07/30/2020-15:39:52] [E] Failed to parse onnx file

I have the same problem.
pytorch 1.4.0 or 1.5.0
onnx 1.6.0 or 1.7.0
tensorrt 7.0.0

i have solved it.
just recompile the newest onnx lib and set opset=11 in trt7. hope it works

We are appreciated that you may provide some detailed help on this.

i have solved it.
just recompile the newest onnx lib and set opset=11 in trt7. hope it works

We are appreciated that you may provide some detailed help on this.

I have solved the problem,
first,
replace your parser/onnx dir with 'https://github.com/onnx/onnx-tensorrt/tree/7.0 '(the newset brach)
and replace the parser/onnx/third_party/onnx with 'https://github.com/onnx/onnx/tree/master' (master branch)

second,
edit one file following:
You could try editing the ONNX parser source like this PR, building it, and seeing if it parses your model successfully: https://github.com/onnx/onnx-tensorrt/pull/418/files
(ref:https://github.com/NVIDIA/TensorRT/issues/422)

rebuild your tensorRT project and replace the libnvonnxparser.so of your system.
it works.

This issue should be solved in the later TensorRT releases. Please upgrade and see if the new releases solves the issue.

If not, feel free to open a new one.

This issue should be solved in the later TensorRT releases. Please upgrade and see if the new releases solves the issue.

If not, feel free to open a new one.

I have faced this problem while parsing my .onnx model using tensorrt7.2.2.3 trtexec.exe.
onnx 1.6.0 pytorch 1.3.1

@shirleyxy can you open an issue with the model you are having trouble importing?

the same problem, pytorch1.6, onnx1.8, tensorrt7.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

flyunix picture flyunix  路  6Comments

qigtang picture qigtang  路  8Comments

basaltzhang picture basaltzhang  路  5Comments

aif2017 picture aif2017  路  3Comments

xiaoxiaotao picture xiaoxiaotao  路  4Comments