mrharicot / monodepth

Unsupervised single image depth prediction with CNNs
Other
2.22k stars 631 forks source link

get_disparity_smoothness broadcast error #163

Closed alwynmathew closed 6 years ago

alwynmathew commented 6 years ago

At get_disparity_smoothness function:

If size of disp is Bx256x512x1, the output of self.gradient_x(disp) will be Bx256x511x1 and self.gradient_y(disp) will be Bx255x512x1.

def gradient_x(self, img):
        gx = img[:,:,:-1,:] - img[:,:,1:,:]
return gx

def gradient_y(self, img):
        gy = img[:,:-1,:,:] - img[:,1:,:,:]
return gy

Thus size of smoothness_x and smoothness_y will be Bx256x511x1 and Bx255x512x1 respectively which cant be added directly without matching the size of the tensors.

mrharicot commented 6 years ago

Hi, This is a known issue, see issue 46.