I'm currently running this:
image = urllib.urlopen(imgUrl)
pool3_features = sess.run(pool3,{'incept/DecodeJpeg/contents:0': image})
and I get this error:
Unable to get element from the feed as bytes.
I'm currently running this:
image = urllib.urlopen(imgUrl)
pool3_features = sess.run(pool3,{'incept/DecodeJpeg/contents:0': image})
and I get this error:
Unable to get element from the feed as bytes.
The solution was quite simple... All I had to do was call the read
method on response from urlopen. The following works like a charm:
image = urllib.urlopen(imgUrl)
pool3_features = sess.run(pool3,{'incept/DecodeJpeg/contents:0': image.read()})
Just use a method to load it into NumPy and then load that into TensorFlow. This is likely more reliable, more flexible.
http://www.pyimagesearch.com/2015/03/02/convert-url-to-image-with-python-and-opencv/