You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
Hello, I am a student who just started to learn machine learning. Your codes were really helpful. I'd like save the codes and restore them later when there were different date sets. I am wondering how I can save the models and successfully restore them later?
@jminsol@HariniNarasimhan. You can both save the model or save the weights. In the case we want to save the weights (less memory usage):
# Include the epoch in the file name (uses `str.format`)checkpoint_path="training/cp-{epoch:04d}.ckpt"checkpoint_dir=os.path.dirname(checkpoint_path)
# Create a callback that saves the model's weights every 5 epochscp_callback=tf.keras.callbacks.ModelCheckpoint(
filepath=checkpoint_path,
verbose=1,
save_weights_only=True,
save_freq=5*batch_size)
# Create a new model instancemodel=create_model()
# Save the weights using the `checkpoint_path` formatmodel.save_weights(checkpoint_path.format(epoch=0))
# Train the modelmodel.fit(...)
# And we want to load the weights usedmodel=create_model()
model.load_weights(...)
Hello, I am a student who just started to learn machine learning. Your codes were really helpful. I'd like save the codes and restore them later when there were different date sets. I am wondering how I can save the models and successfully restore them later?
Here is my code that I've worked on so far.
`
output_predict = minmax.inverse_transform(output_predict)
deep_future = self.anchor(output_predict[:, 0], 0.3)
The text was updated successfully, but these errors were encountered: