tensorflow项目中之前跑通的测试的命令,重新跑时报错,提示:
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:
Assign requires shapes of both tensors to match. lhs shape= [1304] rhs shape= [1320]“
分析: 加载时模型匹配错误。
解决方式:
删除掉原来models里面的所有东西即可,
删除掉:events.out.tfevents.1598404286.HV18080220 graph.pbtxt model.ckpt-0.index
events.out.tfevents.1598404216.HV18080220 events.out.tfevents.1598858193.HV18080220 model.ckpt-0.data-00000-of-00001 model.ckpt-0.meta
在TensorFlow项目中,遇到模型加载失败的问题,错误提示为形状不匹配。本文详细分析了这一常见问题的原因,并提供了有效的解决方案,即清除旧的模型文件和训练数据,确保模型与当前图结构一致。
2295





