2017-04-06 67 views
0

部分:我訓練我自己的數據集,我在tf.image.decode_jpeg得到InvalidArgumentError代碼

label = input_queue[1] 
image_contents = tf.read_file(input_queue[0])  
image = tf.image.decode_jpeg(image_contents, channels=3)  
image = tf.image.resize_image_with_crop_or_pad(image, image_W, image_H) 

錯誤:

INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, Invalid JPEG data, size 300 
     [[Node: DecodeJpeg_2 = DecodeJpeg[acceptable_fraction=1, channels=3, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=false, _device="/job:localhost/replica:0/task:0/cpu:0"](ReadFile_3)]] 

    File "C:/Users/MCRC/made/catdog/training.py", line 97, in <module> 
    run_training() 

    File "C:/Users/MCRC/made/catdog/training.py", line 60, in run_training 
    CAPACITY) 

    File "C:\Users\MCRC\made\catdog\input_data.py", line 100, in get_batch 
    image = tf.image.decode_jpeg(image_contents, channels=3) 

    File "D:\A3\lib\site-packages\tensorflow\python\ops\gen_image_ops.py", line 345, in decode_jpeg 
    dct_method=dct_method, name=name) 

我使用Tensorflow GPU的1.0 Python3。 5在Windows中。任何幫助?

回答

0

聲音像圖像(或其中一個圖像,由於它取決於如何構造input_queue,我無法說出)不是有效的JPEG圖像(文件內容爲300字節)。

+0

謝謝您的建議。我發現了一個不是圖片的文件。 –

相關問題