Skip to content

Commit

Permalink
Move from keras-onnx to tf2onnx
Browse files Browse the repository at this point in the history
The former is incompatible with Tensorflow 2.4+ [1]

[1] onnx/keras-onnx#651
  • Loading branch information
yan12125 committed Jul 1, 2021
1 parent 2cc57ab commit ab22c96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified data/squeezenet_cifar10.onnx
Binary file not shown.
4 changes: 2 additions & 2 deletions utils/export_squeezenet_cifar10.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import tensorflow as tf
import onnx
import keras2onnx
import tf2onnx.convert

with open(os.path.join(sys.argv[1], 'models', 'squeeze_net.json')) as f:
model_json = f.read()
model = tf.keras.models.model_from_json(model_json)
model.load_weights(os.path.join(sys.argv[1], 'models', 'squeeze_net.h5'))

onnx_model = keras2onnx.convert_keras(model, model.name)
onnx_model, _ = tf2onnx.convert.from_keras(model)

onnx.save(onnx_model, 'squeezenet_cifar10.onnx')

0 comments on commit ab22c96

Please sign in to comment.