Open snaki40 opened 3 years ago
也是这个报错
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
似乎是CUDA错误?
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'
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 参考文章中安装方法,没有这个问题了
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成功安装了你推荐的这个,可还是出现相同的报错。
我的环境为:1.7.0+cu101+python3.7.9,该环境没问题,
项目文件夹cmd打开 在cmd中直接conda activate torch107激活环境 然后python demo.py就可以了
cpu下torch不支持半精度,所以half() 出现的地方需要修改为float。
@sssssshf 感谢!直接将AIDetector_pytorch.py文件里面的half()全部替换为float()就可以了
RuntimeError: "unfolded2d_copy" not implemented for 'Half'