z1069614715 / objectdetection_script

一些关于目标检测的脚本的改进思路代码,详细请看readme.md
5.3k stars 476 forks source link

yolov7+DCNv3 训练时报错:RuntimeError: Not implemented on the CPU #19

Closed SkyPoet closed 1 year ago

SkyPoet commented 1 year ago

`File "/home/undergraduate/anaconda3/envs/yolov7p/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 110, in decorate_fwd return fwd(*args, **kwargs) File "/media/kb541/ruanpuchao/yolov7_train/models/ops_dcnv3/functions/dcnv3_func.py", line 39, in forward output = DCNv3.dcnv3_forward(

RuntimeError: Not implemented on the CPU`

我按照视频将DCNv3添加到了yolov7网络中,但是当我开始训练的时候,程序报错RuntimeError: Not implemented on the CPU,我的命令行输入为:python track.py --device 0,1 --epoch 100 --batch_size 32,按理说不会再cpu上运行模型的啊,为什么报这个错误呢?谢谢。

SkyPoet commented 1 year ago

已解决

LCM131855 commented 1 year ago

你好,我也遇到了,你是怎么解决的呢?

777Zhao commented 1 year ago

原因是dcnv3只能在gpu运行,解决办法是把运行模型的的地方都加上 .to(torch.device('cuda'))或者其它可以使模型在gpu上运行的代码就可以了

---原始邮件--- 发件人: @.> 发送时间: 2023年6月14日(周三) 上午9:25 收件人: @.>; 抄送: @.**@.>; 主题: Re: [z1069614715/objectdetection_script] yolov7+DCNv3 训练时报错:RuntimeError: Not implemented on the CPU (Issue #19)

你好,我也遇到了,你是怎么解决的呢?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>