How would you resolve RuntimeError using clip_grad_value_ of list size = 0 in torch?
Working on a CNN in pytorch and used clip_grad_value( ) to deal with gradients. Which lead to the above exception. Was using autograd.grad( ) to calculate gradients instead of backprop for CIFAR10. I used it after the weight updates in torch.no_grad(). Searched online but to no avail on handling the error. Any ideas to what caused this issue and howe to solve it? Thanks. untimeError: Expected !nested_tensorlist[0].empty() to be true, but got false traceback: R<cell line: 0>() 52 model.fc2.weight.copy_(fc2_tmpw) 53 ---> 54 nn.utils.clip_grad_value_(model.parameters(), clip_value=0.1) 55 #print(
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.