在使用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的文档,结果发现是新版本的模型去除了这一功能,所以我们需要做两步事:
- 去网上找一下老版本的image-retraining的模型源码来代替最新版本,如果网上找不到的话请私戳我
- 如果你使用的是最新版本的TensorFlow,可能会出现TensorFlow和image-retraining不兼容的情况,所以请去网上重新下载对应版本的TensorFlow-gpu