Skip to content

Commit

Permalink
fixed indexing in checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rlmwang committed Jan 10, 2021
1 parent 98fc132 commit e7edb01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchtools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, phase, metric):
self.state_dict = None

def step(self, epoch, model):
loss = epoch['score'][self.phase][self.metric][-1]
loss = epoch[self.phase][self.metric][-1]

if self.best is None or loss < self.best:
self.state_dict = model.state_dict()
Expand Down

0 comments on commit e7edb01

Please sign in to comment.