无法读取十位数的jpeg图像

2024-05-15 02:24:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我只是遵循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格式的。有人知道这里有什么问题吗?谢谢!在


Tags: imagereadtfdefas报告错误with
1条回答
网友
1楼 · 发布于 2024-05-15 02:24:27

看看Tensorflow印刷的六边形

\000\000\000\001Bud1\000\000\020\000\000\000\010\000

它看起来像是在试图读取一个.DS存储文件(http://filext.com/file-extension/DS_STORE)。在

确保您没有阅读这些:)

^{pr2}$

相关问题 更多 >

    热门问题