1.错误如下:
ValueError: Tensor("Reshape_7:0", shape=(1, 6), dtype=int32) must be from the same graph as Tensor("word_embedding_matrix:0", shape=(26320, 50), dtype=float32_ref).
'''简写为'''
ValueError: Tensor A must be from the same graph as Tensor B
(1)按照网上的解决办法,添加以下代码:
tf.reset_default_graph()
(2)如果上述方案不好使,去掉(1)中代码,添加一下代码:
with tf.Graph().as_default():
(3)如果上述方案还是不好使,则需要观察在哪里报错,该错误附近即产生了两个graph导致的。如:
tr_data = ImageDataGenerator(train_file,
mode='training',
batch_size&#