for m in model.modules():
if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear):
print(m.weight.data)