错误为:Restoring from checkpoint failed. This is most likely due to a mismatch between the current graph and the graph from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
网上找了许久,大部分原因说是模型不一样。但我的模型是直接复制的,所以不是这个问题。
最后找到解决方案
原来的sever定义:
saver = tf.train.Saver()
更改为:
saver=tf.train.import_meta_graph('./model_CNN/CNN_net.ckpt.meta')
问题解决
TensorFlow模型恢复失败解决
本文解决了在使用TensorFlow从检查点恢复模型时遇到的失败问题。错误提示模型与检查点不匹配。通过更改saver定义,从直接使用Saver()更改为import_meta_graph()方法加载检查点元数据,成功解决了问题。
4770

被折叠的 条评论
为什么被折叠?



