[go: nahoru, domu]

Skip to content

Commit

Permalink
Fix keras model saving error into TF SavedModel format.
Browse files Browse the repository at this point in the history
Now that keras 3 doesn't support model saving format TF SavedModel directly via `model.save()`, we need to use `tf.saved_model.save()` to save the model.

PiperOrigin-RevId: 634985205
  • Loading branch information
jaeyoo authored and tensorflower-gardener committed May 18, 2024
1 parent 52da3cb commit 12dfa7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow/lite/python/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def _generate_integer_tflite_model(quantization_type=dtypes.int8,
# Convert TF Model to an Integer Quantized TFLite Model
converter = tf.lite.TFLiteConverter.from_keras_model(model)
else:
model.save(saved_model_dir)
tf.saved_model.save(model, saved_model_dir)
converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
converter.optimizations = {tf.lite.Optimize.DEFAULT}

Expand Down

0 comments on commit 12dfa7e

Please sign in to comment.