dyh / unbox_yolov5_deepsort_counting

yolov5 deepsort 行人 车辆 跟踪 检测 计数
953 stars 243 forks source link

RuntimeError: "unfolded2d_copy" not implemented for 'Half' #24

Open 58213 opened 3 years ago

58213 commented 3 years ago

报这个错呀 RuntimeError: "unfolded2d_copy" not implemented for 'Half' 请问修改哪个文件

/root/deep_sort/utils/parser.py:23: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. self.update(yaml.load(fo.read())) /root/venv/lib/python3.6/site-packages/torch/cuda/init.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.) return torch._C._cuda_getDeviceCount() > 0 Fusing layers... Traceback (most recent call last): File "main.py", line 79, in bboxes = detector.detect(im) File "/root/detector.py", line 47, in detect pred = self.m(img, augment=False)[0] File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, kwargs) File "/root/models/yolo.py", line 123, in forward return self.forward_once(x, profile) # single-scale inference, train File "/root/models/yolo.py", line 139, in forward_once x = m(x) # run File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "/root/models/common.py", line 171, in forward return self.conv(torch.cat([x[..., ::2, ::2], x[..., 1::2, ::2], x[..., ::2, 1::2], x[..., 1::2, 1::2]], 1)) File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/root/models/common.py", line 45, in fuseforward return self.act(self.conv(x)) File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 423, in forward return self._conv_forward(input, self.weight) File "/root/venv/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 420, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: "unfolded2d_copy" not implemented for 'Half'

kolonten commented 3 years ago

cause:The pytorch conv CPU does not support fp16 solution: Change. Half() to. Float() in utils/general.py 520 line x['model'].float()#half() # to FP16

hecigsape commented 2 years ago

I have the same problem as user 58213, but change

520 line x ['model']. Float () # half () # to FP16

but the error persists

Gabriel-1023 commented 2 years ago

it doesn't work

kkkkwq commented 2 years ago

The same error persists

464hee commented 2 years ago

它不起作用

你解决了吗

Gabriel-1023 commented 2 years ago

它不起作用

你解决了吗

可以把他这个项目里边的模型和权重换成最新的yolov5 6.1版本,models 和 utils 文件夹删除替换就行,权重换成对应版本的权重,详细的操作流程记不清了,但是这么操作最后解决了问题

molua commented 2 years ago

它不起作用

你解决了吗

可以把他这个项目里边的模型和权重换成最新的yolov5 6.1版本,models 和 utils 文件夹删除替换就行,权重换成对应版本的权重,详细的操作流程记不清了,但是这么操作最后解决了问题

我换了,但是没有用T_T

molua commented 2 years ago

我将utils/general.py和detector.py文件里所有的half都换成float就可以运行了

Liu-Yin commented 2 years ago

我也报了这个错误,原因是我电脑用的CPU,把module.py里的两个half()方法改成float()就可以解决了