Load and Save TensorFlow models

Related tutorials:

Save and load trained Models in TensorFlow

Code:

model = tf.keras.Sequential([
  tf.keras.layers.Dense(....)
])
model.compile(loss='mean_squared_error',
              optimizer=tf.keras.optimizers.Adam(0.1))
model.fit(....)

#Save compiled and trained Model
model.save('your-trained-model.model')

#Load compiled and trained Model
model = load_model('your-trained-model.model')
model.compile(...)
 
print(model.predict([....]))


Imports:

import tensorflow as tf
from keras.models import load_model