Skip to content

Commit

Permalink
Removed temporary fix, merged into PyTorch
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanNaren committed Feb 15, 2018
1 parent 525ba52 commit b5fc467
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,6 @@ def update(self, val, n=1):
momentum=args.momentum, nesterov=True)
if not args.finetune: # Don't want to restart training
optimizer.load_state_dict(package['optim_dict'])

# Temporary fix for pytorch #2830 & #1442 while pull request #3658 in not incorporated in a release
# TODO : remove when a new release of pytorch include pull request #3658
if args.cuda:
for state in optimizer.state.values():
for k, v in state.items():
if torch.is_tensor(v):
state[k] = v.cuda()

start_epoch = int(package.get('epoch', 1)) - 1 # Index start at 0 for training
start_iter = package.get('iteration', None)
if start_iter is None:
Expand Down

0 comments on commit b5fc467

Please sign in to comment.