In section 5.6 - Train the Model
I get the error output
ValueError: No gradients provided for any variable: ['generated_image:0'].
when I add the noise to generated_image as
generated_image = tf.Variable(tf.image.convert_image_dtype(content_image, tf.float32))
noise = tf.random.uniform(tf.shape(generated_image), 0, 0.5)
generated_image = tf.add(generated_image, noise)
generated_image = tf.clip_by_value(generated_image, clip_value_min=0.0, clip_value_max=1.0)
If I only use original image as Input
generated_image = tf.Variable(tf.image.convert_image_dtype(content_image, tf.float32))
no error will occur
I think it is a bug in the exercise, how can I fix this?
Another problem is that In Exercise 6 - train_step
The testing code for evaluating cost for epoch 0, I get output 10221.33203125, but the answer is 10221.168, which is a very little error, I’ve passed every test for functions before this test, is this also a bug or if I miss anything?