PaddlePaddle / Knover

Large-scale open domain KNOwledge grounded conVERsation system based on PaddlePaddle
Apache License 2.0
673 stars 131 forks source link

关于./scripts/single_gpu的训练参数保存问题(paddle-2.2.2) #141

Open M-aterialism opened 2 years ago

M-aterialism commented 2 years ago

你好,我在使用./scripts/single_gpu/train.sh时,会报出

Traceback (most recent call last): File "./knover/scripts/train.py", line 250, in <module> train(args) File "./knover/scripts/train.py", line 170, in train save_model(model, args.save_path, "best", args) File "./knover/scripts/train.py", line 242, in save_model model.save(path, is_checkpoint=args.save_checkpoint) File "/home/aistudio/work/Knover/knover/core/model.py", line 541, in save paddle.save(self._dist_model.state_dict(), params_path) AttributeError: 'ModelInterface' object has no attribute '_dist_model'

的错误,而在使用./scripts/destributed/train.sh时,就不会出现,请问可以解决吗?

sserdoubleh commented 2 years ago

https://github.com/PaddlePaddle/Knover/blob/53d5b20319b5e9e26cc598628eece9f86a7dc7ea/knover/core/model.py#L541 这里你先把改成 self._dist_model 改成 self._model 哈,我这边同步测试一下,会不会影响其他功能,测试没有问题的话加个 patch 修复一下

sserdoubleh commented 2 years ago

测试无问题,已经合入了,你拉最新代码就好哈