【发布时间】:2021-08-20 01:50:27
【问题描述】:
我已使用 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))
你能给我一些关于如何进行的建议吗?任何“快速”的解决方案?还是我应该重新编码?
【问题讨论】:
标签: python python-3.x tensorflow tensorflow2.0