Recall & Review
beginner
What does 'saving weights only' mean in TensorFlow?
It means saving just the learned parameters (weights and biases) of a model, without saving the model's architecture or optimizer state.
Click to reveal answer
beginner
How do you save only the weights of a TensorFlow model?
Use the method
model.save_weights('path') to save only the weights to the specified path.Click to reveal answer
beginner
How do you load saved weights back into a TensorFlow model?
Use
model.load_weights('path') to load the saved weights into the model with the same architecture.Click to reveal answer
intermediate
Why might you want to save only weights instead of the full model?
Saving only weights is smaller in size and useful when you want to recreate the model architecture separately or share just the learned parameters.
Click to reveal answer
intermediate
What file formats can TensorFlow use to save weights?
TensorFlow can save weights in TensorFlow checkpoint format (default) or in HDF5 format if the filename ends with
.h5.Click to reveal answer
Which TensorFlow method saves only the weights of a model?
✗ Incorrect
model.save_weights() saves only the weights. model.save() saves the full model.
What must you do before loading saved weights into a model?
✗ Incorrect
The model architecture must match to load weights correctly.
What file extension saves weights in HDF5 format in TensorFlow?
✗ Incorrect
Using .h5 extension saves weights in HDF5 format.
Why might saving only weights be preferred over saving the full model?
✗ Incorrect
Weights files are smaller because they exclude architecture and optimizer info.
Which of these is NOT saved when using
model.save_weights()?✗ Incorrect
model.save_weights() does not save the model architecture.
Explain the process and benefits of saving only weights in TensorFlow models.
Think about what is saved and why it might be useful.
You got /5 concepts.
Describe how to load saved weights into a TensorFlow model and what conditions must be met.
Consider what is needed before loading weights.
You got /4 concepts.