You should probably take another look at the Doc. I remembered state_dict is not a attribute nor a property: it is a function, as described in the traceback. So, you should use state_dict = lstm.state_dict()