[Python] Error:MetaGraphDef associated with tags 'serve' could not be found in SavedModel

Discussão em 'Python' iniciado por Stack, Abril 16, 2025.

  1. Stack

    Stack Membro Participativo

    I have this error

    RuntimeError: MetaGraphDef associated with tags 'serve' could not be found in SavedModel. To inspect available tag-sets in the SavedModel, please use the SavedModel CLI: `saved_model_cli`
    available_tags: [{'train', 'serve'}]


    I did saved_model_cli show --dir ./, I got

    MetaGraphDef with tag-set: 'train, serve' contains the following SignatureDefs:


    My source code is

    import tensorflow as tf

    with tf.Session(graph=tf.Graph()) as sess:
    tf.saved_model.loader.load(sess,[tf.saved_model.tag_constants.SERVING],'../export_dir/0/')
    graph = tf.get_default_graph().as_graph_def()
    with tf.gfile.GFile('./frozen.pb', "wb") as f:
    f.write(graph.SerializeToString())


    When I search this problem solution, I saw "Use [tf.saved_model.tag_constants.SERVING]", but I cannnot solve this problem...

    Continue reading...

Compartilhe esta Página