I came across the same problem. This is because
optimizer = optim.SGD(net.parameters(), lr=0.001, momentum=0.9)
So you need to define optimizer again after net.cuda(), i.e.
net.cuda()
optimizer = optim.SGD(net.parameters(), lr=0.001, momentum=0.9)
Then it will be solved.