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

.export_graph takes forever

Open Rishit-dagli opened this issue 4 years ago • 1 comments

Describe the bug

While trying to convert a small ~90 MB ONNX model to TensorFlow, it takes forever on some models.

To Reproduce

onnx_model = onnx.load(model_onnx)
onnx.checker.check_model(onnx_model)
tf_rep = prepare(onnx_model)
tf_rep.export_graph("saved_model")

It seems to have been stuck on

ONNX model file

https://drive.google.com/file/d/19hL2naOt0NfmopS2yX_cn_VYgR19nbqd/view?usp=sharing

Python, ONNX, ONNX-TF, Tensorflow version

This section can be obtained by running get_version.py from util folder.

  • Python version: 3.7
  • ONNX version: 1.10.1
  • ONNX-TF version: 1.9.0
  • Tensorflow version: 2.6

Rishit-dagli avatar Oct 23 '21 14:10 Rishit-dagli

It is quite interesting that:

  • using opset 9 instead of 10 to generate the ONNX model
  • And using onnx-tf convert instead of programmatically converting

does seem to work, this model still takes ~30 min whereas it takes lot less time to convert other larger models.

Rishit-dagli avatar Oct 24 '21 04:10 Rishit-dagli