Lv-Aige 2023-05-27 00:09 采纳率: 0%
浏览 244
已结题

RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'

YOLOv5+DeepSORT目标识别跟踪项目
运行报错:RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'
网上搜到是无卡运行不能用GPU函数的原因 但是找不到half()函数 不知如何修改
完整报错如下:
(venv) C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main>python demo.py
fps: 25
Traceback (most recent call last):
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\demo.py", line 55, in
main()
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\demo.py", line 27, in main
result = det.feedCap(im)
^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\utils\BaseDetector.py", line 35, in feedCap
im, faces, face_bboxes = update_tracker(self, im)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\tracker.py", line 40, in update_tracker
_, bboxes = target_detector.detect(image)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\AIDetector_pytorch.py", line 47, in detect
pred = self.m(img, augment=False)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\models\yolo.py", line 117, in forward
return self.forward_once(x, profile) # single-scale inference, train
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\models\yolo.py", line 148, in forward_once
x = m(x) # run
^^^^
File "C:\Users\86183\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\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 "C:\Users\86183\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\Desktop\Yolov5-Deepsort-main\Yolov5-Deepsort-main\models\common.py", line 45, in fuseforward
return self.act(self.conv(x))
^^^^^^^^^^^^
File "C:\Users\86183\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\86183\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'

  • 写回答

6条回答 默认 最新

  • 喝茶品人生 2023-05-27 01:40
    关注
    获得1.95元问题酬金

    先看看GPU支持半精度浮点数吗,在修改下AIDetector_pytorch.py文件的数据类型:img = img.float()

    评论

报告相同问题?

问题事件

  • 系统已结题 6月4日
  • 创建了问题 5月27日

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料