Skip to content

Instantly share code, notes, and snippets.

@AkiyonKS
Created August 9, 2022 05:11
Show Gist options
  • Save AkiyonKS/2cac3f9d0120472f640e15b39fba07f8 to your computer and use it in GitHub Desktop.
Save AkiyonKS/2cac3f9d0120472f640e15b39fba07f8 to your computer and use it in GitHub Desktop.
model_for_export = tfmot.sparsity.keras.strip_pruning(model_for_pruning)
_, pruned_keras_file = tempfile.mkstemp('.h5')
tf.keras.models.save_model(model_for_export, pruned_keras_file, include_optimizer=False)
print('Saved pruned Keras model to:', pruned_keras_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment