-
Notifications
You must be signed in to change notification settings - Fork 96
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: Expected object of scalar type float but got scalar type double for argument 'other' #17
Comments
我也出现了 |
因为,数据是双精度的啊,而需要的是单精度的。 |
请问这个错误具体应该怎么改呢?我尝试改了几个地方的,但是还是有错误 |
@taochongxin 模型权重和数据均是有精度的。 一般来讲,自定义的模型,如果没有特别指定,一般都是单精度的,也就是float, 主要问题应该是出在你的数据上,你把你的数据,的dtype打印出来,看看是什么。 然后把模型和数据的 dtype改成一样的就可以了。 这个问题也一般会出现在损失函数中,反正涉及到权重的地方都会有精度问题。你统一了就好了 |
@yatengLG 多谢回复,我使用的数据集也是voc2007,我再尝试改一下,谢谢 |
我都改成双精度了,可以跑通 |
我也遇到这个问题了 |
@dfy888 精度问题,模型精度和数据精度不一致。 |
AttributeError: 'DataLoader' object has no attribute 'dtype' |
然后你数据也是同样的,只要是tensor肯定有dtype的 |
@dfy888 dataloader 是个 数据加载器的类,不是你的输入数据。 |
关于这个报错,统一回复: 原因是
具体查看方法是
解决方法:
|
我到不了那里 刚刚定位了一下是这里的问题: |
终于跑起来了 我自己的数据集 print("这里的错啊:", gt_boxes.dtype, gt_boxes.size())
希望可以帮到跟我一样的朋友 再次感谢作者的注释 |
No description provided.
The text was updated successfully, but these errors were encountered: