Using v1 RC, I built my model as such:
var trainingPipeline = modelConfig.pipeline .Append(modelConfig.mlContext.MulticlassClassification.Trainers .SdcaNonCalibrated("Label", "Features")) .Append(modelConfig.mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Then later on when trying to load the mode zip, I get the following error:
FormatException: Couldn't load model: 'TransformerChain\Transform_001\Model'
Code to load the model (exception is thrown in the .Load call)
ITransformer loadedModel; using (var stream = new FileStream(modelPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { loadedModel = _mlContext.Model.Load(stream, out var modelInputSchema); }
The Model.Load code worked correctly with a model trained like these:
var trainingPipeline = modelConfig.pipeline .Append(modelConfig.mlContext.MulticlassClassification.Trainers .LbfgsMaximumEntropy("Label", "Features")) .Append(modelConfig.mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
and
var trainingPipeline = modelConfig.pipeline .Append(modelConfig.mlContext.MulticlassClassification.Trainers .SdcaMaximumEntropy("Label", "Features")) .Append(modelConfig.mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Using v1 RC, I built my model as such:
var trainingPipeline = modelConfig.pipeline .Append(modelConfig.mlContext.MulticlassClassification.Trainers .SdcaNonCalibrated("Label", "Features")) .Append(modelConfig.mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
Then later on when trying to load the mode zip, I get the following error: FormatException: Couldn't load model: 'TransformerChain\Transform_001\Model'
Code to load the model (exception is thrown in the .Load call)
ITransformer loadedModel; using (var stream = new FileStream(modelPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { loadedModel = _mlContext.Model.Load(stream, out var modelInputSchema); }
The Model.Load code worked correctly with a model trained like these:
var trainingPipeline = modelConfig.pipeline .Append(modelConfig.mlContext.MulticlassClassification.Trainers .LbfgsMaximumEntropy("Label", "Features")) .Append(modelConfig.mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));
andvar trainingPipeline = modelConfig.pipeline .Append(modelConfig.mlContext.MulticlassClassification.Trainers .SdcaMaximumEntropy("Label", "Features")) .Append(modelConfig.mlContext.Transforms.Conversion.MapKeyToValue("PredictedLabel"));