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

fix KeyError when delte idx from task_infos #54498

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Jun 9, 2023

PR types

Bug fixes

PR changes

APIs

Description

Pcard-71594

num_workers > 0 训练过程中经常出现如下报错
image

  • 已有相关问题(未解决):dataloader里面 del self._task_infos[idx] KeyError #41635
  • 问题定位:在 _task_infos 中尝试删除 idx 时,idx 并不存在于 task_infos 中,从而引起 KeyError
  • 解决方法:暂时采用比较简单的解决方法,在 del 之前加一个 if 判断(但这不是最好的解决办法,因为 pytorch 代码类似,但应该不会出现这种问题,猜测是 _task_infos 这个变量在多线程的情况下有隐蔽问题导致)

@paddle-bot
Copy link

paddle-bot bot commented Jun 9, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@heavengate heavengate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cxxly cxxly merged commit 38f38a9 into PaddlePaddle:develop Jun 13, 2023
@HydrogenSulfate HydrogenSulfate deleted the fix_dataloader_error branch June 13, 2023 08:24
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

Successfully merging this pull request may close these issues.

3 participants