chenxie95 / deeplearning_course_sjtu

14 stars 2 forks source link

torch.save不应该直接保存model,应改为model.state_dict() #28

Closed yfyeung closed 1 year ago

yfyeung commented 1 year ago

https://github.com/chenxie95/deeplearning_course_sjtu/blob/master/languagemodel/main.py#L228

yfyeung commented 1 year ago

直接保存 model 在 torch.load 的时候加载目录与保存目录要相同,否则会报错: AttributeError: Can get attribute RNNModel on ...