Skip to content

无法使用torch.load加载保存下来的model #16

Description

@yysirs

Trainer训练完成后,使用torch.load,无法加载保存下来的模型
报错:

ModuleNotFoundError: No module named 'model'

我查看了Fastnlp中Trainer保存best model的代码,是

model.cpu()
torch.save(model,model_path)

使用torch.load应该没有问题的,请问作者大大怎么加载训练完成的best model

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions