Tensorflow 2.0 model checkpoint files to .pb/onnx file

Issue

For model checkpoint files (usually consist of .meta, .data, .index) generated from TF-2.0, how can I convert it to onnx or pb file?
since I found most of the existing tools, such as tf2onnx only support TF-1.x.

Solution

tf2onnx supports tf2, saved models, and checkpoint files. I would recommend making a saved model:

model.save("path")

Then use tf2onnx command line:

tf2onnx.convert --saved-model path/to/model --output model.onnx --opset 12

https://github.com/onnx/tensorflow-onnx#–saved-model

Answered By – user2008981

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published