result type Float can‘t be cast to the desired output type long int

找到utils的loss.py文件,找到下面两行

ctrl f搜索anchors = self.anchors[i],换成anchors, shape = self.anchors[i], p[i].shape

 ctrl f 搜索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)))

就可以开始训练

indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1))) # image, anchor, grid

猜你喜欢

转载自blog.csdn.net/weixin_47037450/article/details/130557039