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

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

Open
M-aterialism opened this issue Jun 8, 2022 · 2 comments

Comments

@M-aterialism
Copy link

M-aterialism commented Jun 8, 2022

你好,我在使用./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时,就不会出现,请问可以解决吗?

@M-aterialism M-aterialism changed the title 关于./scripts/single_gpu的训练参数保存问题 关于./scripts/single_gpu的训练参数保存问题(paddle-2.2.2) Jun 8, 2022
@sserdoubleh
Copy link
Collaborator

paddle.save(self._dist_model.state_dict(), params_path)

这里你先把改成 self._dist_model 改成 self._model 哈,我这边同步测试一下,会不会影响其他功能,测试没有问题的话加个 patch 修复一下

@sserdoubleh
Copy link
Collaborator

sserdoubleh commented Jun 9, 2022

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

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