2024-09-28 05:22:06 发布
网友
我正在运行这个:
image = urllib.urlopen(imgUrl) pool3_features = sess.run(pool3,{'incept/DecodeJpeg/contents:0': image})
我得到一个错误:
Unable to get element from the feed as bytes.
只需使用一个方法将其加载到NumPy中,然后将其加载到TensorFlow中。这可能更可靠、更灵活。在
http://www.pyimagesearch.com/2015/03/02/convert-url-to-image-with-python-and-opencv/
解决办法很简单。。。我所要做的就是对来自urlopen的响应调用read方法。以下是一种魅力:
read
image = urllib.urlopen(imgUrl) pool3_features = sess.run(pool3,{'incept/DecodeJpeg/contents:0': image.read()})
只需使用一个方法将其加载到NumPy中,然后将其加载到TensorFlow中。这可能更可靠、更灵活。在
http://www.pyimagesearch.com/2015/03/02/convert-url-to-image-with-python-and-opencv/
解决办法很简单。。。我所要做的就是对来自urlopen的响应调用
read
方法。以下是一种魅力:相关问题 更多 >
编程相关推荐