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

训练出现长警告 #8419

Closed
2 of 3 tasks
GuoQuanhao opened this issue Jul 9, 2023 · 7 comments
Closed
2 of 3 tasks

训练出现长警告 #8419

GuoQuanhao opened this issue Jul 9, 2023 · 7 comments
Assignees
Labels
bug Something isn't working status/close

Comments

@GuoQuanhao
Copy link

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

训练出现长警告

I0706 13:09:13.075042 3772 eager_method.cc:140] Warning:: 0D Tensor cannot be used as 'Tensor.numpy()[0]' . In order to avoid this problem, 0D Tensor will be changed to 1D numpy currently, but it's not correct and will be removed in release 2.6. For Tensor contain only one element, Please modify 'Tensor.numpy()[0]' to 'float(Tensor)' as soon as possible, otherwise 'Tensor.numpy()[0]' will raise error in release 2.6.
I0706 13:09:13.382442 3772 eager_method.cc:140] Warning:: 0D Tensor cannot be used as 'Tensor.numpy()[0]' . In order to avoid this problem, 0D Tensor will be changed to 1D numpy currently, but it's not correct and will be removed in release 2.6. For Tensor contain only one element, Please modify 'Tensor.numpy()[0]' to 'float(Tensor)' as soon as possible, otherwise 'Tensor.numpy()[0]' will raise error in release 2.6.

复现环境 Environment

PaddleDetection2.6
PaddlePaddle2.5.0

经过排查将ppdet/utils/stats.py第77行进行如下修改
v.update(stats[k].numpy())v.update(float(stats[k]))

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@GuoQuanhao GuoQuanhao added the bug Something isn't working label Jul 9, 2023
@nemonameless
Copy link
Collaborator

感谢反馈,会尽快修复

@sdreamforchen
Copy link

感谢反馈,会尽快修复

我也遇到这个问题。但是有一次又出现是int。 所以这里是不是不要numpy()更好

@zdong22
Copy link

zdong22 commented Jul 26, 2023

的确有这个问题,其它项目中看到是需要回退paddle版本到2.4,如 PaddlePaddle/PaddleOCR#10295 ,这样能解决最好,感谢 GuoQuanhao

@lizhaoliaooo
Copy link

感谢这位同学

@joisonwk
Copy link

这个有修复了吗? 我也遇到这个2.5.1 将loss_function返回的张量转numpy就会一直打印此警告。

@JiFfeng-Yu
Copy link

PaddleDetection2.6第77行原本就是这个了v.update(float(stats[k]))

@linuaries
Copy link

解决困扰我许久的问题,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status/close
Projects
None yet
Development

No branches or pull requests

9 participants