Skip to content

Draft: Model output autonaming

Cresson Remi requested to merge wip_model_output_autonaming into develop

Now no need to explicitely name the model layers to be able to grab the output:

before

    def get_outputs(self, normalized_inputs: dict) -> dict:
        ...
        softmax_op = tf.keras.layers.Softmax(name=OUTPUT_SOFTMAX_NAME)
        softmax = softmax_op(out_tconv4)
        argmax_op = otbtf.layers.Argmax(name=OUTPUT_ARGMAX_NAME)
        labels = argmax_op(softmax)

        return {"tgt": softmax, "unused_output": labels}

And calling TensorflowModelServe with output.name equal to OUTPUT_SOFTMAX_NAME or OUTPUT_ARGMAX_NAME

after

    def get_outputs(self, normalized_inputs: dict) -> dict:
        ...
        softmax_op = tf.keras.layers.Softmax()  # note: no name
        softmax = softmax_op(out_tconv4)
        argmax_op = otbtf.layers.Argmax()  # note: no name
        labels = argmax_op(softmax)

        return {"tgt": softmax, "argmax": labels}

And calling TensorflowModelServe with output.name equal to "tgt" or "argmax"

Edited by Cresson Remi

Merge request reports