deep-learning-with-python-notebooks icon indicating copy to clipboard operation
deep-learning-with-python-notebooks copied to clipboard

5.4-visualizing-what-convnets-learn

Open prateekvyas1996 opened this issue 4 years ago • 2 comments

There is a problem in code number 13 where K.gradients is used it should be modified with tf.GradientTape

prateekvyas1996 avatar Jul 07 '20 11:07 prateekvyas1996

I'm struggling with this problem. Could you please tell me how I can change my code using GradientTape?

sinano1107 avatar Feb 26 '21 01:02 sinano1107

I had the same problem. I implemented this answer and it solved the issue.

It suggests adding the following code before calling K.gradients:

import tensorflow as tf tf.compat.v1.disable_eager_execution()

rredondoo avatar Mar 18 '21 02:03 rredondoo