Open tetelias opened 3 years ago
I had the same question, do you solve it?
I have solved it, because the type of output is torch.float16, but the type of masks and rmasks is torch.float 32, so transform the type
if features.is_cuda: masks = masks.type(torch.half) rmasks = rmasks.type(torch.half) carafe_ext.forward(features, rfeatures, masks, rmasks, kernel_size, group_size, scale_factor, routput, output)
I update the code for the issue, it worked for me.
if features.is_cuda:
if features.type() == 'torch.cuda.HalfTensor':
masks = masks.type(torch.half)
rmasks = rmasks.type(torch.half)
carafe_ext.forward(features, rfeatures, masks, rmasks, kernel_size,
group_size, scale_factor, routput, output)
Installed correctly, grad_check runs without errors as does the sample code. When trying to use either native torch amp or original NVidia one, I receive the same error: