Skip to content

Instantly share code, notes, and snippets.

@thierryherrmann
Created August 2, 2020 23:48
Show Gist options
  • Select an option

  • Save thierryherrmann/eebb3ca30a13a477d4764bdec731a7a8 to your computer and use it in GitHub Desktop.

Select an option

Save thierryherrmann/eebb3ca30a13a477d4764bdec731a7a8 to your computer and use it in GitHub Desktop.
# instantiate a new module and save it untrained
module = CustomModule()
save_module(module, model_dir)
del module
print('\n\n========== Reload module ===========')
# the following works also if we reload in another python process
model_dir = 'saved_model'
new_module = tf.keras.models.load_model(model_dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment