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

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/

你可能感兴趣的:(tensorflow.python.framework.errors_impl.InvalidArgumentError: Restoring from checkpoint failed.)