In order to access a model\'s parameters in pytorch, I saw two methods:
using state_dict and using parameters()
I wonder what\'s the difference, or if one is good
Besides the differences in @kHarshit 's answer, the attribute requires_grad of trainable tensors in net.parameters() is True, while False in net.state_dict()
requires_grad
net.parameters()
True
False
net.state_dict()