byol-pytorch icon indicating copy to clipboard operation
byol-pytorch copied to clipboard

Warning: grad and param do not obey the gradient layout contract.

Open mohaEs opened this issue 3 years ago • 3 comments

Has anybody gotten a similar warning when using it?

Warning: grad and param do not obey the gradient layout contract. This is not an error, but may impair performance. grad.sizes() = [512, 256, 1, 1], strides() = [256, 1, 1, 1] param.sizes() = [512, 256, 1, 1], strides() = [256, 1, 256, 256] (function operator())

mohaEs avatar Jan 13 '22 19:01 mohaEs

@mohaEs, I just started training BYOL with my custom dataset and got the same warning too. Did your model performed better on the downstream task? Does this warning effect the performance?

hcmea avatar Feb 04 '22 22:02 hcmea

I got the same warning too. And the loss becomes NaN during training. Still not figured it out.

zmzhang2000 avatar Mar 09 '22 03:03 zmzhang2000

I got the same warning too. And the loss becomes NaN during training. Still not figured it out.

I set the input to be contiguous and then the warning disappeared.

input = input.contiguous()

zmzhang2000 avatar Mar 11 '22 14:03 zmzhang2000