Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import tensorflow as tf
  2.  
  3. # The export path contains the name and the version of the model
  4. tf.keras.backend.set_learning_phase(0) # Ignore dropout at inference
  5. model = tf.keras.models.load_model('model_ecg.h5')
  6. export_path = 'ecg_identifier/1'
  7.  
  8. # Fetch the Keras session and save the model
  9. # The signature definition is defined by the input and output tensors
  10. # And stored with the default serving key
  11. with tf.keras.backend.get_session() as sess:
  12. tf.saved_model.simple_save(
  13. sess,
  14. export_path,
  15. inputs={t.name: t for t in model.inputs},
  16. outputs={t.name: t for t in model.outputs})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement