RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same
个人分析报错原因是在使用单GPU的时候Yolov5会开启半精度,但是我在数据处理的时候漏掉了这种情况。
临时解决方式:
由于时间有限,暂时把单GPU开启半精度的功能注释掉了
更好的方式:
在数据处理阶段增加使用半精度模式时img = img.half()
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same
个人分析报错原因是在使用单GPU的时候Yolov5会开启半精度,但是我在数据处理的时候漏掉了这种情况。
临时解决方式:
由于时间有限,暂时把单GPU开启半精度的功能注释掉了
更好的方式:
在数据处理阶段增加使用半精度模式时img = img.half()