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)) –