Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserWarning: Couldn't retrieve source code for container of type ConditionalRandomField. It won't be checked for correctness upon loading. #8

Closed
s1162276945 opened this issue Dec 17, 2019 · 1 comment

Comments

@s1162276945
Copy link

Trainer的sava_path不为None的时候,会出现:
UserWarning: Couldn't retrieve source code for container of type ConditionalRandomField. It won't be checked for correctness upon loading.
虽然也保存了模型,但是加载之后会报错,请问这个怎么处理呢?

@yhcc
Copy link
Member

yhcc commented Dec 17, 2019

因为当前Trainer用的torch.save直接save整个model,所以需要在训练时相同路径下加载才能正确运行。如果只保存参数,请使用https://fastnlp.readthedocs.io/zh/latest/fastNLP.core.callback.html#fastNLP.core.callback.SaveModelCallback这个Callback。

@yhcc yhcc closed this as completed Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants