1. 程式人生 > >image—retraining模型載入訓練自己的模型時報錯

image—retraining模型載入訓練自己的模型時報錯

在使用image-retraining訓練自己的影象分類時候有時會報TypeError: Cannot interpret feed_dict key as Tensor: The name ‘DecodeJpeg/contents:0’ refers to a Tensor which does not exist. The operation, ‘DecodeJpeg/contents’, does not exist in the graph.的錯誤。這個錯誤應該是最近才出現的,我查了很多網站都沒有結果,然後我去翻了一下谷歌最新的image-retraining的文件,結果發現是新版本的模型去除了這一功能,所以我們需要做兩步事:

  1. 去網上找一下老版本的image-retraining的模型原始碼來代替最新版本,如果網上找不到的話請私戳我
  2. 如果你使用的是最新版本的TensorFlow,可能會出現TensorFlow和image-retraining不相容的情況,所以請去網上重新下載對應版本的TensorFlow-gpu