Skip to content

Commit

Permalink
Fix a bug when saving checkpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebgao committed Jun 28, 2023
1 parent 97d36c7 commit ddc6ba3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imagenet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def save_checkpoint(config, epoch, model, max_accuracy, optimizer, lr_scheduler,
'epoch': epoch,
'config': config}
if config.AMP_OPT_LEVEL != "O0":
save_state['amp'] = amp.state_dict()
# save_state['amp'] = amp.state_dict()
pass

save_path = os.path.join(config.OUTPUT, f'ckpt_epoch_{epoch}.pth')
logger.info(f"{save_path} saving......")
Expand Down

0 comments on commit ddc6ba3

Please sign in to comment.