我正在尝试使用TensorFlow从VGG网络中提取功能 . 我正在加载一批1000个图像,形状为numpy数组(1000,448,448,3),并尝试使用feed_dict为此批次提供网络:

pool = sess.run(vgg.lastpool, feed_dict={vgg.imgs: [image_list]})

其中image_list是前面提到的形状数组(1000,448,448,3) .

但是,我收到以下错误:

ValueError: Cannot feed value of shape (1, 1000, 448, 448, 3) for Tensor u'Placeholder:0', which has shape '(?, 448, 448, 3)'

当我尝试使用单个图像(shape =(1,448,448,3))时,它可以工作,但是当我尝试提供批处理时,它会添加这个随机维度 . 我尝试使用numpy的挤压,但同样的事情发生......在使用feed_dict之前,我检查了image_list肯定是形状(1000,448,448,3) .