YuHengsss / YOLOV

This repo is an implementation of PyTorch version YOLOV Series
Apache License 2.0
278 stars 39 forks source link

Input type and weight type mismatch #59

Closed medinaltbx closed 1 year ago

medinaltbx commented 1 year ago

Hello, while trying to execute vid_demo.py on CPU to test the yolov_s.pth model with an MP4 video (416px), I encountered the following error:

image

I haven't modified the code in vid_demo.py or yolov_s.py. Command used:

python tools\vid_demo.py -f exps\yolov\yolov_s.py -c weights\yolov_s.pth --path videos\test_17.mp4 --conf 0.25 --nms 0.5 --tsize 576 --device cpu

Thank you for your work.

Rownak commented 10 months ago

Hi @medinaltbx have you got any solution to this error? I have been getting the same error. "RuntimeError: Input type (torch.FloatTensor) and weight type (torch.HalfTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor" yolov_error

It worked on GPU. python tools/vid_demo.py -f exps/yolov/yolov_s.py -c weights/yolov_s.pth --path videos/2794976541.mp4 --conf 0.25 --nms 0.5 --tsize 576 --device gpu