jpeg729:

for p in model.parameters():
p.data.fill_(0)


It works well, thank you!



 jpeg729:

model.layer1.weight.data.fill_(0)
model.layer1.bias.data.fill_(0)


But this one doesn’t.
It says my model has no layer1 attribute.