ERROR,Restoring from checkpoint failed. This is most likely due to a mismatch between the current gr

在TensorFlow项目中,遇到模型加载失败的问题,错误提示为形状不匹配。本文详细分析了这一常见问题的原因,并提供了有效的解决方案,即清除旧的模型文件和训练数据,确保模型与当前图结构一致。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值