RuntimeError: Not implemented on the CPU
ChenJian7578 opened this issue · 1 comments
Traceback (most recent call last):
File "train.py", line 986, in
main(opt)
File "train.py", line 688, in main
train(opt.hyp, opt, device, callbacks)
File "train.py", line 216, in train
model = Model(cfg or ckpt["model"].yaml, ch=3, nc=nc, anchors=hyp.get("anchors")).to(device) # create
File "/home/data/chenjian/yolov5/models/yolo.py", line 253, in init
m.stride = torch.tensor([s / x.shape[-2] for x in _forward(torch.zeros(1, ch, s, s))]) # forward
File "/home/data/chenjian/yolov5/models/yolo.py", line 249, in _forward
return self.forward(x)[0] if isinstance(m, Segment) else self.forward(x)
File "/home/data/chenjian/yolov5/models/yolo.py", line 268, in forward
return self._forward_once(x, profile, visualize) # single-scale inference, train
File "/home/data/chenjian/yolov5/models/yolo.py", line 168, in _forward_once
x = m(x) # run
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/data/chenjian/yolov5/models/common.py", line 115, in forward
x = self.dcnv4(x, shape)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1190, in _call_impl
return forward_call(*input, **kwargs)
File "/home/data/chenjian/yolov5/DCNv4_op/DCNv4/modules/dcnv4.py", line 130, in forward
x = DCNv4Function.apply(
File "/usr/local/lib/python3.8/dist-packages/torch/cuda/amp/autocast_mode.py", line 97, in decorate_fwd
return fwd(*args, **kwargs)
File "/home/data/chenjian/yolov5/DCNv4_op/DCNv4/functions/dcnv4_func.py", line 103, in forward
output = ext.dcnv4_forward(*args)
RuntimeError: Not implemented on the CPU
I saw solution on csdn: https://blog.csdn.net/weixin_57112913/article/details/137019225