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

GPU训练下无法使用numpy #51

Open
DnkNju opened this issue Oct 14, 2022 · 1 comment
Open

GPU训练下无法使用numpy #51

DnkNju opened this issue Oct 14, 2022 · 1 comment

Comments

@DnkNju
Copy link

DnkNju commented Oct 14, 2022

作者您好
训练一段时间之后出现这样的问题
截屏2022-10-14 下午2 03 06
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu()
就是说GPU环境没办法将tensor转换成numpy,需要在哪里添加".cpu()"呢

@WuTi0525
Copy link

你可以尝试修改utils/utils.py line 819 中的 targets.append([i, cls, x, y, w, h, conf])为 targets.append([i, cls, x.cpu(), y.cpu(), w.cpu(), h.cpu(), conf.cpu()])

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