onnx / onnx-tensorrt

ONNX-TensorRT: TensorRT backend for ONNX
Apache License 2.0
2.95k stars 545 forks source link

error in ONNX Python backend usage #175

Closed hgnan closed 3 years ago

hgnan commented 5 years ago

I followed the "ONNX Python backend usage " , but I Encountered an error

This is the error message: `hgnan@jetson-nano:~/nas/onnx-tensorrt$ python3 Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import onnx import onnx_tensorrt.backend as backend model = onnx.load("yolov3.onnx") import numpy as np engine = backend.prepare(model, device='CUDA:0') Traceback (most recent call last): File "trt-backend.py", line 6, in engine = backend.prepare(model, device='CUDA:0') File "/home/hgnan/nas/onnx-tensorrt/onnx_tensorrt/backend.py", line 217, in prepare super(TensorRTBackend, cls).prepare(model, device, **kwargs) File "/home/hgnan/.local/lib/python3.6/site-packages/onnx/backend/base.py", line 74, in prepare onnx.checker.check_model(model) File "/home/hgnan/.local/lib/python3.6/site-packages/onnx/checker.py", line 86, in check_model C.check_model(model.SerializeToString()) onnx.onnx_cpp2py_export.checker.ValidationError: Nodes in a graph must be topologically sorted, however input 'y3:01' of node: input: "y3:01" output: "TFNodes/yolo_evaluation_layer_1/Shape_3:0" name: "TFNodes/yolo_evaluation_layer_1/Shape_3" op_type: "Shape" is not output of any previous nodes.

`

Please advise me how I can resolve or help resolve this error. This is my environment message : `hgnan@jetson-nano:~/nas/onnx-tensorrt$ jetson_release

kevinch-nv commented 4 years ago

This looks like an issue within the model itself. Can you provide us with the model?

kevinch-nv commented 3 years ago

Closing due to inactivity - if you are still having issues with the latest version of onnx-tensorrt feel free to open a new issue.