onnx-tensorflow
onnx-tensorflow copied to clipboard
Error using the export_graph function
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
Did you solve this error? I am stuck on the same error
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
Can anyone please share the yolov5 onnx file for debugging?
A PR is opened to fix it, https://github.com/onnx/onnx-tensorflow/pull/990. Please check it out to see if it helps.
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:
- 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'
)
- 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)
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.