0
我處理以下錯誤:如何在Python中爲Tensorflow預測設置圖像形狀?
ValueError: Cannot feed value of shape (32, 32, 3) for Tensor 'Placeholder:0', which has shape '(?, 32, 32, 3)'
佔位符設置爲:x = tf.placeholder(tf.float32, (None, 32, 32, 3))
而且圖像(運行print(img1.shape)
時),具有輸出:(32, 32, 3)
我怎樣才能更新運行時要對齊的圖像:print(sess.run(correct_prediction, feed_dict={x: img1}))
重塑IMG(1,32,32,3) –
謝謝!有關如何做到這一點的任何提示? –
img.reshape((1,32,32,3)) –