【发布时间】:2021-05-10 15:51:19
【问题描述】:
我正在使用 Detectron2 训练 Faster R-CNN 模型进行对象检测,我想训练模型 zoo 给出的模型,输入范围为 [0 1] 而不是 [0 255] 所以我使用了颜色变换调用我的函数 scale_transform
def scale_transform(img):
return img/255.
这个函数正在接收一个 numpy 数组并将其按比例返回。但是,在训练时会出现此错误
RuntimeError: Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
有人知道我该如何解决这个问题吗?或其他方式来缩放检测器2的图像?
谢谢
【问题讨论】:
标签: python object-detection image-preprocessing detectron