1 问题描述
RuntimeError: result type Float can't be cast to the desired output type __int64
2 解决方法
utils\loss.py中修改两处,采用全局搜索。
# 原代码
anchors = self.anchors[i]
# 修改为
anchors,shape = self.anchors[i], p[i].shape
# 原代码
indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices
# 修改为
indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1)))
最后跑通ok!!!