我已将tf_upgrade_v2用于将TF1代码升级到TF2。但我对两者都是新手。我遇到了以下错误:
RuntimeError: tf.placeholder() is not compatible with eager execution.
我有一些tf.compat.v1.placeholder()
。
self.temperature = tf.compat.v1.placeholder_with_default(1., shape=())
self.edges_labels = tf.compat.v1.placeholder(dtype=tf.int64, shape=(None, vertexes, vertexes))
self.nodes_labels = tf.compat.v1.placeholder(dtype=tf.int64, shape=(None, vertexes))
self.embeddings = tf.compat.v1.placeholder(dtype=tf.float32, shape=(None, embedding_dim))
你能给我一些建议如何继续吗?有任何“快速”解决方案吗?还是我需要重新编码?
tf.compat.v1.disable_eager_execution()
,谢谢~ - Rγσ ξηg Lιαη Ημ 雷欧