tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed.

博客指出,output的checkpoint中有数据,导致出现shape不一致的情况,上次运行训练任务生成的模型与现在的模型shape不同,因此在运行前需清空之前的output,并给出了清空命令。

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

InvalidArgumentError (see above for traceback): 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:

    530 tensorflow.python.framework.errors_impl.InvalidArgumentError: 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:
    531 
    532 Assign requires shapes of both tensors to match. lhs shape= [27,768] rhs shape= [10,768]
    533      [[{{node save/Assign_200}} = Assign[T=DT_FLOAT, _class=["loc:@output_weights"], use_locking=true, validate        _shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](output_weights, save/RestoreV2/_403)]]

可能就是output的checkpoint中有数据的问题,导致出现了shape不一致的情况,上次运行其他训练任务的时候生成的模型和现在也生成的模型的shape不一致,所以这里需要在运行前先清空之情的output。

        --output_dir=/tmp/mrpc_output/

rm -rf /tmp/mrpc_output/

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值