Skip to content Skip to sidebar Skip to footer

Keras: No Gradients Provided For Any Variable

I am working on a GAN based problem and I am getting this issue where the gradients are not visible. I was hoping if someone can help me here. I have two main piece of codes that m

Solution 1:

You are using numpy operations in several places inside the scope of GradientTape, for example in the line

fake_hr_patchs = np.reshape(fake_hr_patchs, (8,128,128))

Replace all numpy functions inside GradientTape's scope with their tensorflow equivalents. For example, the above line becomes:

fake_hr_patchs = tf.reshape(fake_hr_patchs, (8,128,128))

Post a Comment for "Keras: No Gradients Provided For Any Variable"