0

I'm trying to extract features from VGG net using TensorFlow. I am loading a batch of 1000 images in a numpy array of shape (1000, 448, 448, 3) and trying to use feed_dict to feed the network with this batch:

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

where image_list is the aforementioned array of shape (1000, 448, 448, 3).

However, I'm getting the following error:

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

When I try with a single image (shape = (1, 448, 448, 3)), it works, but when I try to feed a batch it adds this random dimension. I tried to use numpy's squeeze, but same thing happens... And before using feed_dict, I checked that image_list is definitely of shape (1000, 448, 448, 3).

stop-cran
  • 4,229
  • 2
  • 30
  • 47

0 Answers0