Project 23: Model Save to Disk
ML Engineer
Builds on these lessons
Current Task
Objective
MLOps is about running models reliably in practice — starting with the basics of persisting a trained model to disk.
Task: compile a small model and save it to a .keras file.
index.py
import tensorflow as tf
from tensorflow.keras import layers, Sequential
model = Sequential([layers.Dense(1, input_shape=(1,))])
model.compile(optimizer='sgd', loss='mse')
model.save('weather_model.keras')
print('saved')
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview