以下提醒是指这个向量不能训练,还是指初始梯度为0?
错误信息:
[w 1125 15:50:58.680000 00 grad.cc:63] grads[15]
‘style.15.bias’ doesn’t have gradient. It will be set to zero: Var(00000217F250DE40:1:1:0:i0:o0:s1,float32,style.15.bias,00000217E38AEC60)[512,]
我的代码:
class EqualConv2d(nn.Module):
def __init__(
self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True
):
super().__init__()
self.weight = jt.randn(out_channel, in_channel, kernel_size, kernel_size)