The requires_grad attribute you are printing from sd['fc.weight'].requires_grad is the default one for torch.Tensors.



 n0obcoder:

So looking at the information that it holds it feels like saving the state_dict should be saving the requires_grad flag too…


I don’t think so, as the state_dict is supposed to store only the parameters, not the computation etc.
@John_Deterious’s suggestion to store the complete model might work.



 n0obcoder:

and whats the best way to save the state of the optimizers ? why do we even need to save optimizer’s state?


I would follow the ImageNet example 35 and store a custom dict containing all data I would like to store. Some optimizers use internal buffers (e.g. running estimates etc.), that should also be stored/restored, if you plan on continuing the training.