Skip to content

Commit

Permalink
Merge pull request #61 from MadryLab/fix-amp-loading-bug
Browse files Browse the repository at this point in the history
Small fix regarding old non-amp saved models
  • Loading branch information
andrewilyas committed Jul 13, 2020
2 parents 375d9ef + 97eea42 commit b3bdf61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion robustness/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def lr_func(ep):
for i in range(steps_to_take):
schedule.step()

if 'amp' in checkpoint and checkpoint['amp'] is not None:
if 'amp' in checkpoint and checkpoint['amp'] not in [None, 'N/A']:
amp.load_state_dict(checkpoint['amp'])

# TODO: see if there's a smarter way to do this
Expand Down

0 comments on commit b3bdf61

Please sign in to comment.