解决方法1:
报错代码:
anchor_points = self.anchor_points(samples).repeat(batch_size, 1, 1)
output_coord = regression + anchor_points
修改后代码:
anchor_points = self.anchor_points(samples).repeat(batch_size, 1, 1)
# decode the points as prediction
# output_coord = regression + anchor_points.to(regression.device)
解决方法2:
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
g = g.to(device)
model=model.to(device)