torchbearer icon indicating copy to clipboard operation
torchbearer copied to clipboard

GradientNormClipping callback error

Open dimimal opened this issue 4 years ago • 0 comments

When I insert this callback in the trial I get the following error. Is this some kind of bug? It seems like the gradients are not passed in the callback.

""" File "/home/dimitris/.local/lib/python3.6/site-packages/torch/nn/utils/clip_grad.py", line 30, in clip_grad_norm_ total_norm = torch.norm(torch.stack([torch.norm(p.grad.detach(), norm_type) for p in parameters]), norm_type) RuntimeError: stack expects a non-empty TensorList """

dimimal avatar May 20 '20 20:05 dimimal