I have a saved state_dict() in  a .pth file and I’m trying to extract only the weights from this dictionary.
I tried loading the state_dict() using load_state_dict() and accessing the weights as follows
m = model.load_state_dict()
print(m['weight'])

However, this is giving me the following error: TypeError: tuple indices must be integers or slices, not str 
which tells me I can’t access the weights by just using the key, how can I obtain the weights in this case?