Open mdelhussieny opened 2 years ago
Hi, This will not work with TF 2.0. I guess you might be using TF2.0. I am yet to do the model to work with this version of TensorFlow. However, use TF 1.14 and Keras 2.2.4 for the model. It will output the correct losses. I appreciate if you work on it. I have other jobs at the moment and will get to this soon.
TF 2.0 if effective if you use Gradient Tape. So this is something in the feature in a separate branch for the model to work.
ones = K.ones_like(y_pred[:,:,:,1])
will give you tensor of ones, reversed_mask = Lambda(self.reverse_mask,output_shape=(self.img_shape_mask))(mask)
will give you tensor of zeros. So
masking = Multiply()([reversed_mask,input_img]), predicting = Multiply()([reversed_mask, output_img])
will be zero. that is my point nothing related to TF version
Yes, the pull request you added for the loss is the original loss I used during training. But now with TF 2.0 D loss is zero. However with TF 1.14, everything works fine.
I have several comments on your work first: Wasserstein loss always return zero in case of fake images as fake (
np.zeros
) from the discriminator so it cannot distinguish the fake from the real.second: your reverse mask loss always get zero