Fork me on CSDN

RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.

导包时加入以下代码:

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

 

posted @ 2021-07-22 19:14  追风赶月的少年  阅读(1717)  评论(0编辑  收藏  举报