Open SUNHAOH opened 1 year ago
请问 我在训练时提示 result type Float can't be cast to the desired output type __int64 是什么原因?
我在yolov5中遇到过这个问题,你可以贴一下你的torch和cuda版本,,我觉得和这个有关。我torch1.7.0和cuda11.0没问题。
嗯是
解决方法步骤:
解决方法步骤:
- 将yolo_training.py文件中的451行的【anchors_i= torch.from_numpy(self.anchors[i] / self.stride[i]).type_as(predictions[i])】修改为【anchors_i,shape = torch.from_numpy(self.anchors[i] / self.stride[i]).type_as(predictions[i]),predictions[i].shape】
- 将yolotraining.py文件中的513行的【indices.append((b, a, gj.clamp(0, gain[3] - 1), gi.clamp(0, gain[2] - 1)))】修改为【indices.append((b, a, gj.clamp(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1)))】
- 完成以上两步即可。
感谢大佬
我也处理一下哈。
请问 我在训练时提示 result type Float can't be cast to the desired output type __int64 是什么原因?