Skip to content

❓ What should I do if I want to save weights every 5 cycles? Thanks #1615

Answered by blaz-r
shz1314 asked this question in Q&A
Discussion options

You must be logged in to vote

You will need to modify the following code:

checkpoint = ModelCheckpoint(
dirpath=os.path.join(config.project.path, "weights", "lightning"),
filename="model",
monitor=monitor_metric,
mode=monitor_mode,
auto_insert_metric_name=False,
)

and add every_n_epochs or every_n_train_steps or whichever suits you. You might need to remove monitor, but I am not sure. Check ModelCheckpoint page for more details on checkpointing.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by samet-akcay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1501 on January 10, 2024 11:16.