RuntimeError: tf.placeholder() is not compatible with eager execution.

在原代码前加 tf.compat.v1.disable_eager_execution()

如self.X = tf.compat.v1.placeholder(tf.float32,shape[None,self.time_steps,self.input_dim],name='input_X')

改为

tf.compat.v1.disable_eager_execution()

self.X =tf.compat.v1.placeholder(tf.float32,shape[None,self.time_steps,self.input_dim],name='input_X')

你可能感兴趣的:(tensorflow)