mdsarfarazulh / deep-texture-synthesis-cnn-keras

MIT License
7 stars 1 forks source link

tf.gradients is not supported when eager execution is enabled. #3

Open eliashahbazi opened 4 years ago

eliashahbazi commented 4 years ago

I installed all the dependencies and ran the code , I have this error

File "/home/lnuser/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gradients_util.py", line 504, in _GradientsHelper raise RuntimeError("tf.gradients is not supported when eager execution " RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.

I changed the line and added GradientTape but still the code does not work

hanyiabc commented 4 years ago

Add this line after importing tensorflow

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