fastnlp / fastNLP

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.
https://gitee.com/fastnlp/fastNLP
Apache License 2.0
3.05k stars 451 forks source link

如何加载保存后的模型, 并预测结果 #315

Closed Yiwen-Yang-666 closed 3 years ago

Yiwen-Yang-666 commented 3 years ago

您好, 我在模型的forward函数里用了vocabulary, 将预测的结果转化为label, 但是预测结果非常差, 可是日志里的metrics结果非常好, 所以我估计我没有调用保存后的模型, 按照API, trainer.train()里面我添加了保存路径, 训练后, 模型保存了下来。 然后测试时, 我用tester.test()预测结果, 但是结果非常差, 请问, 该如何调用保存后的模型。

Yiwen-Yang-666 commented 3 years ago

我用的是0.5.5版本

Yiwen-Yang-666 commented 3 years ago

已解决 #302