我只是遵循Tensorflow教程,在MacOS上用1个映像测试了inception3(我使用的是python3.6.4和Pycharm)。这是报告错误的部分。在
......
with tf.gfile.FastGFile('inception_model/classify_image_graph_def.pb', 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
tf.import_graph_def(graph_def, name = '')
with tf.Session() as sess:
softmax_tensor = sess.graph.get_tensor_by_name('softmax:0')
#tranverse the directory
for root, dirs, files in os.walk('images/'):
for file in files:
#load the image
image_data = tf.gfile.FastGFile(os.path.join(root, file), 'rb').read()
predictions = sess.run(softmax_tensor, {'DecodeJpeg/contents:0' : image_data})
......
以下是报告的错误:
^{pr2}$我使用的图像肯定是Jpeg格式的。有人知道这里有什么问题吗?谢谢!在
看看Tensorflow印刷的六边形
它看起来像是在试图读取一个.DS存储文件(http://filext.com/file-extension/DS_STORE)。在
确保您没有阅读这些:)
^{pr2}$相关问题 更多 >
编程相关推荐