detr-pytorch icon indicating copy to clipboard operation
detr-pytorch copied to clipboard

运行报错

Open ChristmasLee opened this issue 2 years ago • 5 comments
trafficstars

b导,我在跑您的detr代码时,训练10个epoch没问题,但是在每十个epoch计算一次mAP的时候报错: File "/opt/data/private/detr/utils/utils_bbox.py", line 31, in forward boxes = boxes * scale_fct[:, None, :] RuntimeError: expected device cuda:0 and dtype Float but got device cuda:0 and dtype Long 这是怎么回事呢?

ChristmasLee avatar Mar 08 '23 02:03 ChristmasLee

image

ChristmasLee avatar Mar 08 '23 03:03 ChristmasLee

训练的指令 torch的版本是什么呢

bubbliiiing avatar Mar 10 '23 15:03 bubbliiiing

训练指令: CUDA_VISIBLE_DEVICES=0, nohup python3 train.py & torch版本1.2.0如图: image

ChristmasLee avatar Mar 11 '23 03:03 ChristmasLee

b导,我现在跑detr还是遇到这个问题,就是在验证集计算mAP的时候报错 RuntimeError: expected device cuda:0 and dtype Float but got device cuda:0 and dtype Long 我的torch版本是1.2,是不是要升到1.7啊?

ChristmasLee avatar Apr 18 '23 07:04 ChristmasLee

b导,我现在跑detr还是遇到这个问题,就是在验证集计算mAP的时候报错 RuntimeError: expected device cuda:0 and dtype Float but got device cuda:0 and dtype Long 我的torch版本是1.2,是不是要升到1.7啊?

我修改了30,31,41行就可以运行了。 0f21c91bf018a5dea39ec71f6f0248b

alubawzk avatar May 08 '23 04:05 alubawzk