onnx-tensorflow icon indicating copy to clipboard operation
onnx-tensorflow copied to clipboard

Error using the export_graph function

Open AlexisPapaioannou opened this issue 2 years ago • 6 comments

Describe the bug

I used the onnx-tensorflow repository in order to convert yolov5 model to tensorflow but I received the following error.

Python, ONNX, ONNX-TF, Tensorflow version

  • Python version: 3.6.0
  • ONNX version: 1.9.0
  • ONNX-TF version: 1.9.0
  • Tensorflow version: 2.6.0

Additional context

139688478-ed708932-170d-4a81-91b4-f017a44d8e62

AlexisPapaioannou avatar Nov 02 '21 07:11 AlexisPapaioannou

Did you solve this error? I am stuck on the same error

I-am-vishalmaurya avatar Nov 16 '21 02:11 I-am-vishalmaurya

Same here. Currently working with YoloV5, wanted to change the model to tensorflow and ran into this error. I am using Tensorflow version: 2.7.0

prikmm avatar Nov 22 '21 12:11 prikmm

Can anyone please share the yolov5 onnx file for debugging?

chinhuang007 avatar Nov 23 '21 18:11 chinhuang007

A PR is opened to fix it, https://github.com/onnx/onnx-tensorflow/pull/990. Please check it out to see if it helps.

chinhuang007 avatar Nov 23 '21 20:11 chinhuang007

A PR is opened to fix it, #990. Please check it out to see if it helps.

Thanks for your working. I try to install from your branch and convert yolov5s into tensorflow pb, but it doesn't work, either.

Environment:

  • OS: Windows 10 (Should I use Linux?)
  • python: 3.6.2
  • onnx: 1.10.2
  • onnx-tf: 1.9.0
  • tf: 2.6.2

Ways to convert:

  1. code:
def export_onnx_to_tf(onnx_model_path, tf_model_path):
    onnx_model = onnx.load(onnx_model_path)
    tf_rep = prepare(onnx_model)
    tf_rep.export_graph(tf_model_path)

export_onnx_to_tf(
    'checkpoints/yolov5s.onnx',
    'checkpoints/yolov5s'
)
  1. CLI: onnx-tf.exe convert -i .\yolov5s.onnx -o yolov5s

Pycharm Output:

2021-11-26 21:59:05.666159: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-11-26 21:59:05.666416: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Process finished with exit code -1073741819 (0xC0000005)

yolov5s.zip

hebangwen avatar Nov 26 '21 14:11 hebangwen

A PR is opened to fix it, #990. Please check it out to see if it helps.

Recently I found that yolov5 has original tensorflow implementation. So I can get frozen graph directly. Thanks for your working.

hebangwen avatar Nov 28 '21 03:11 hebangwen