Thank you very much for your work, I found an anomaly when I try to differentiate it and do the backward step, your Net has many in-place operations which makes it impossible to calculate the gradients. If anyone encounters the same problem replace the first few lines in the forward function to:
def forward(self, img):
blurred_img_r = self.gaussian_filter_vertical(self.gaussian_filter_horizontal(img[:, 0:1]))
blurred_img_g = self.gaussian_filter_vertical(self.gaussian_filter_horizontal(img[:, 1:2]))
blurred_img_b = self.gaussian_filter_vertical(self.gaussian_filter_horizontal(img[:, 2:3]))
grad_x_r = self.sobel_filter_horizontal(blurred_img_r)
grad_y_r = self.sobel_filter_vertical(blurred_img_r)
grad_x_g = self.sobel_filter_horizontal(blurred_img_g)
grad_y_g = self.sobel_filter_vertical(blurred_img_g)
grad_x_b = self.sobel_filter_horizontal(blurred_img_b)
grad_y_b = self.sobel_filter_vertical(blurred_img_b)
Thank you very much for your work, I found an anomaly when I try to differentiate it and do the backward step, your Net has many in-place operations which makes it impossible to calculate the gradients. If anyone encounters the same problem replace the first few lines in the forward function to: