ValueError: Input graph and Layer graph are not the same: Tensor("hidden2/Relu:0", shape=(4, 150), d

时间:2023-02-03 09:53:59

Once you have launched a sess, you can use your_tensor.eval(session=sess) or sess.run(your_tensor) to get you feed tensor into the format of numpy.array and then feed it to your placeholder.

  • 数据集过大的时候placeholder不适应,直接从文件读取:
    The cnn_1.py in your git repo is modified from the original file in the official tutorial of TF right? If you have a close look at its original code, you will find no placeholders in it which means the input of the model is the second way(readings from files not feeding) according to this, as a result, you can’t feed any data to this model.
    Since cifar10 is not a small dataset like mnist, placeholder is not suitable for this kind of large datasets, personally I think reading inputs from files is the best way to train it. If you still want to use placeholder you’d better write a next_batch method in mnist for cifar10 so as to feed the placeholder<

cankao:https://github.com/tensorflow/tensorflow/issues/4842