2017-06-22 71 views
0

我想重新訓練tiff圖像的初始模塊。我已按照https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#0中的步驟操作。但是,似乎tiff圖像不被支持起始模塊,因爲我收到以下錯誤用tiff圖像重新訓練初始圖像

2017-06-22 16:52:56.712653: W tensorflow/core/platform /cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1  instructions, but these are available on your machine and could speed up CPU  computations. 
Looking for images in 'Type 1' 
No files found 
Looking for images in 'Type 2' 
No files found 
No valid folders of images found at Myfolder 

有沒有辦法解決這個問題? 在此先感謝!

回答

2

你說得對,TensorFlow不支持TIFF圖像。

在這裏看到:Tensorflow Machine Learning: No Decoder for TIFF Images?

如果你想使用TIFF圖像,你可以使用一個像庫或PILPillow可以讀取TIFF圖像並將其轉換成numpy的陣列送入TensorFlow。

查看Working with TIFFs (import, export) in Python using numpy舉例。

如果您有大量的TIFF文件,上述操作會使訓練速度變慢,因爲您將花費更多時間讀取並解碼TIFF文件,導致數據GPU捱餓。

在這種情況下,請查看https://www.tensorflow.org/extend/new_data_formats瞭解如何支持自定義文件格式。