TensorFlow Cannot feed value of shape (100, 784) for Tensor 'Placeholder:0'

后端 未结 3 717
-上瘾入骨i
-上瘾入骨i 2021-01-13 14:41

I am learning TensorFLow. So to understand how to make something, I tried to copy some code from a source and execute it. But I\'m hitting an error message. So I tried some

3条回答
  •  耶瑟儿~
    2021-01-13 15:14

    You are getting that error because there is a mismatch between the shape of what you are feeding in and what the TensorFlow is expecting. To fix the issue, you might want to reshape your data at placeholder:0 which is batch_X to (?, 28, 28, 1). For example, you would do the following:

    batch_X = np.reshape(batch_X, (-1, 28, 28, 1))
    

提交回复
热议问题