Closed
Description
When I resume training, I encountered a Runtime error
Traceback (most recent call last): File "trainval_net.py", line 339, in <module> optimizer.step() File "/pytorch/lib/python3.6/site-packages/torch/optim/sgd.py", line 101, in step buf.mul_(momentum).add_(1 - dampening, d_p) RuntimeError: expected type torch.FloatTensor but got torch.cuda.FloatTensor
I search through the issues and find issue #475 has the same error. But it seems the problem has been solved and merged.
So I add the lines that the merge request removed and problem is solved.
add lines
if args.cuda:
fasterRCNN.cuda()
if args.optimizer == "adam":
lr = lr * 0.1
optimizer = torch.optim.Adam(params)
So I think there are still some problems with the RuntimeError.
Metadata
Metadata
Assignees
Labels
No labels