How can I get the weights of a PyTorch model?
I've just built a PyTorch model and want to get the weights of each layer.
What is the best way to do it?
I've just built a PyTorch model and want to get the weights of each layer.
What is the best way to do it?
It's easy to do if you use PyTorch.
for name, param in model.named_parameters():
# layer name, layer weights
params.append(param)