TensorFlow saver failed to restore model

TensorFlow 加载checkpoint文件时,出现如下错误:

tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key XX/XX/XX/X not found in checkpoint

解决步骤:

1. 使用TensorFlow的inspect_checkpoint.py 检测checkfile是否还有需要的graph key:

       python inspect_checkpoint.py --file_name=""

2. 假如有这时候看TensorFlow的版本是否和训练时的一致

3. 检查训练时Python的版本是2.X还是3.X,是否和当前load一致

4. 假如找到类似的名字但是有部分不一致,很有可能是处理代码里面有代码出错

你可能感兴趣的:(TensorFlow saver failed to restore model)