Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • otbtf otbtf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

La forge institutionnelle d'INRAE étant en production depuis le 10 juin 2025, nous vous recommandons d'y créer tous vos nouveaux projets.

  • Cresson Remi
  • otbtfotbtf
  • Merge requests
  • !96

Draft: Model output autonaming

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Cresson Remi requested to merge wip_model_output_autonaming into develop Aug 23, 2023
  • Overview 0
  • Commits 6
  • Pipelines 3
  • Changes 3

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 Aug 23, 2023 by Cresson Remi
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip_model_output_autonaming