Skip to content

Commit

Permalink
Swap the try and except blocks for ModelCheckpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
taiypeo authored Feb 2, 2022
1 parent 8310971 commit 686047e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ def main(args):
try:
args.checkpoint_callback = ModelCheckpoint(
save_top_k=-1,
period=1,
every_n_epochs=1,
verbose=True,
)
except TypeError:
logger.warning(
"'period' parameter of ModelCheckpoint has been renamed to 'every_n_epochs'."
"'every_n_epochs' parameter of ModelCheckpoint is not found. "
+ "Defaulting to its old name, 'period'."
)
args.checkpoint_callback = ModelCheckpoint(
save_top_k=-1,
every_n_epochs=1,
period=1,
verbose=True,
)

Expand Down

0 comments on commit 686047e

Please sign in to comment.