Skip to content

Commit

Permalink
Fix bug in load_model in training
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDoYup authored Jan 30, 2021
1 parent cff901f commit 0f22e7f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/fixmatch/fixmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ def load_model(self, load_path):
eval_model.load_state_dict(checkpoint[key])
elif key == 'it':
self.it = checkpoint[key]
elif key == 'scheduler':
self.scheduler.load_state_dict(checkpoint[key])
elif key == 'optimizer':
self.optimizer.load_state_dict(checkpoint[key])
else:
getattr(self, key).load_state_dict(checkpoint[key])
self.print_fn(f"Check Point Loading: {key} is LOADED")
Expand Down

0 comments on commit 0f22e7f

Please sign in to comment.