Skip to content

ImageClassificationTrainer PredictedLabelColumnName bug when the name is not default #7452

Closed

Description

@Lavshyak

System Information (please complete the following information):

  • OS & Version: Windows 11
  • ML.NET Version: ML.NET v4.0.2
  • .NET Version: .NET 9.0
  • Microsoft.ML.Vision 4.0.2
  • SciSharp.TensorFlow.Redist 2.3.1 (or Windows GPU 2.3.1)

Describe the bug
If ImageClassificationTrainer.Options PredictedLabelColumnName = "PredictedLabel" (default), no bugs.
But if ImageClassificationTrainer.Options PredictedLabelColumnName = "PredictedLabelKey" (not default), i get exception "Could not find input column 'PredictedLabelKey' (Parameter 'inputSchema')" from KeyToValueMappingTransformer (inputColumnName: "PredictedLabelKey") when Fit().

Expected behavior
No exception

Screenshots, Code, Sample Projects
Project with reproduction and xunit: https://github.com/Lavshyak/MLNetImageClassificationTrainerPredictedColumnNameProblem/blob/master/MLNetImageClassificationTrainerPredictedColumnNameProblem/UnitTest1.cs

Activity

  1. locked and limited conversation to collaborators on Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions