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

RuntimeError: Found dtype Double but expected Float #8

Open
scb-vs5 opened this issue Apr 3, 2024 · 3 comments
Open

RuntimeError: Found dtype Double but expected Float #8

scb-vs5 opened this issue Apr 3, 2024 · 3 comments

Comments

@scb-vs5
Copy link

scb-vs5 commented Apr 3, 2024

想问一下执行的时候,scaler.scale(loss).backward会报错,Found dtype Double but expected Float,在stackoverflow上面查找并尝试了多种方式,但是一直没能解决,想请教一下这个该怎么处理?

@scb-vs5
Copy link
Author

scb-vs5 commented Apr 3, 2024

子loss和总loss我看到都是torch.float32了的,但是很奇怪它还是会报错,不知道是不是环境的问题?我用的是pytorch1.8,请问有什么思路嘛

@scb-vs5
Copy link
Author

scb-vs5 commented Apr 3, 2024

跑通,换成更高版本的torch(我的是1.12.1)再加调试一下即可

@Felix-fz
Copy link

请问你是直接在他这个代码基础上跑通的吗,有没有做修改

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