Pytorch.load() error:No module named 'model'

Thank you very much. It has been done by the way you said. Since the model needs to be initialized by passing in a ‘’ data ‘’ object that contains parameters to build the model, I save the model directly. If only save the parameters, I need to create a ‘’ data ‘’ object when you build the model. It’s troublesome. Is there any good way?