You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
laulampaul
changed the title
Face Nan when using cl.ContextualBilateralLoss(use_vgg=False, loss_type='cosine').cuda()
Nan when using cl.ContextualBilateralLoss(use_vgg=False, loss_type='cosine').cuda()
Jun 1, 2022
When I use the codes :
After some iterations, I face the NAN problem, how can I debug ??
Thanks.
The text was updated successfully, but these errors were encountered: