Skip to content
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

error #10

Open
snaki40 opened this issue Feb 17, 2021 · 9 comments
Open

error #10

snaki40 opened this issue Feb 17, 2021 · 9 comments

Comments

@snaki40
Copy link

snaki40 commented Feb 17, 2021

RuntimeError: "unfolded2d_copy" not implemented for 'Half'

@maxtorgithub
Copy link

也是这个报错
E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\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()))
Fusing layers...
fps: 25
Traceback (most recent call last):
File "demo.py", line 54, in
main()
File "demo.py", line 28, in main
result = det.feedCap(im, func_status)
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\utils\BaseDetector.py", line 35, in feedCap
im, faces, face_bboxes = update_tracker(self, im)
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\tracker.py", line 42, in update_tracker
_, bboxes = target_detector.detect(image)
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\AIDetector_pytorch.py", line 47, in detect
pred = self.m(img, augment=False)[0]
File "C:\Users\acer\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\yolo.py", line 112, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\yolo.py", line 128, in forward_once
x = m(x) # run
File "C:\Users\acer\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\common.py", line 90, 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 "C:\Users\acer\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\coding\图像识别\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\common.py", line 34, in fuseforward
return self.act(self.conv(x))
File "C:\Users\acer\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\conv.py", line 423, in forward
return self._conv_forward(input, self.weight)
File "C:\Users\acer\AppData\Local\Programs\Python\Python37\lib\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'

@Sharpiless
Copy link
Owner

似乎是CUDA错误?

@yang7ke
Copy link

yang7ke commented Feb 19, 2021

python3.8也出现这个问题

F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\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()))
Fusing layers...
fps: 16
Traceback (most recent call last):
  File "demo.py", line 54, in <module>
    main()
  File "demo.py", line 28, in main
    result = det.feedCap(im, func_status)
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\utils\BaseDetector.py", line 35, in feedCap
    im, faces, face_bboxes = update_tracker(self, im)
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\tracker.py", line 42, in update_tracker
    _, bboxes = target_detector.detect(image)
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\AIDetector_pytorch.py", line 50, in detect
    pred = self.m(img, augment=False)[0]
  File "C:\Users\yangqike\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\yolo.py", line 112, in forward
    return self.forward_once(x, profile)  # single-scale inference, train
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\yolo.py", line 128, in forward_once
    x = m(x)  # run
  File "C:\Users\yangqike\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\common.py", line 90, 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 "C:\Users\yangqike\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "F:\Download\Yolov5-deepsort-inference-master\Yolov5-deepsort-inference-master\models\common.py", line 34, in fuseforward
    return self.act(self.conv(x))
  File "C:\Users\yangqike\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "C:\Users\yangqike\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\conv.py", line 423, in forward
    return self._conv_forward(input, self.weight)
  File "C:\Users\yangqike\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\conv.py", line 419, in _conv_forward
    return F.conv2d(input, weight, self.bias, self.stride,
RuntimeError: "unfolded2d_copy" not implemented for 'Half'

@maxtorgithub
Copy link

pip3 install torch==1.7.0+cu101 torchvision==0.8.1+cu101 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
参考文章中安装方法,没有这个问题了

@yang7ke
Copy link

yang7ke commented Feb 21, 2021

pip3 install torch==1.7.0+cu101 torchvision==0.8.1+cu101 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
参考文章中安装方法,没有这个问题了

我用Python3.8成功安装了你推荐的这个,可还是出现相同的报错。

@Sharpiless
Copy link
Owner

Sharpiless commented Feb 24, 2021

我的环境为:1.7.0+cu101+python3.7.9,该环境没问题,

@JingyibySUTsoftware
Copy link

项目文件夹cmd打开
在cmd中直接conda activate torch107激活环境
然后python demo.py就可以了

@sssssshf
Copy link

cpu下torch不支持半精度,所以half() 出现的地方需要修改为float。

@Picaun
Copy link

Picaun commented May 30, 2023

@sssssshf 感谢!直接将AIDetector_pytorch.py文件里面的half()全部替换为float()就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants