Open laulampaul opened 2 years ago
When I use the codes :
def calculate_cobiloss(img,gt): bb = img.shape[0] loss = 0. cobiloss = cl.ContextualBilateralLoss(use_vgg=False, loss_type='cosine').cuda() for i in range(bb): imgpatches = sample_patches(img[i],10,5) gtpatches = sample_patches(gt[i],10,5) c, patch_size, patch_size, n_patches = imgpatches.shape imgpatches = imgpatches.reshape(1,c*patch_size*patch_size,n_patches,1) gtpatches = gtpatches.reshape(1,c*patch_size*patch_size,n_patches,1) #pdb.set_trace() loss = loss + cobiloss(imgpatches,gtpatches) return loss/bb
After some iterations, I face the NAN problem, how can I debug ?? Thanks.
When I use the codes :
After some iterations, I face the NAN problem, how can I debug ?? Thanks.