Search code examples
tensorflowkerascoreml

How do I change the ouput's name in a CoreML model from Identity to something else?


The output layer's name in the tensorflow model has been customized, and yet when I try to convert it using CoreML, it will not recognize the layer unless I use "Identity" when I try and assign an output_description.


Solution

  • You can load the mlmodel file using coremltools in a Python script, then use the rename_feature function to rename the output.

    See the documentation at https://coremltools.readme.io/docs/mlmodel-utilities