where _onnxPath is the output path for the onnx file.
However, I get the following error.
System.Collections.Generic.KeyNotFoundException
HResult=0x80131577
Message=The given key 'SentimentText_TextNormalizer' was not present in the dictionary.
Source=System.Private.CoreLib
StackTrace:
at System.ThrowHelper.ThrowKeyNotFoundException[T](T key)
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.ML.Model.OnnxConverter.OnnxContextImpl.GetVariableName(String colName)
at Microsoft.ML.Transforms.Text.WordTokenizingTransformer.Mapper.SaveAsOnnx(OnnxContext ctx)
at Microsoft.ML.Data.RowToRowMapperTransform.Microsoft.ML.Model.OnnxConverter.ISaveAsOnnx.SaveAsOnnx(OnnxContext ctx)
at Microsoft.ML.Model.OnnxConverter.SaveOnnxCommand.ConvertTransformListToOnnxModel(OnnxContextImpl ctx, IChannel ch, IDataView inputData, IDataView outputData, LinkedList`1 transforms, HashSet`1 inputColumnNamesToDrop, HashSet`1 outputColumnNamesToDrop)
at Microsoft.ML.OnnxExportExtensions.ConvertToOnnxProtobufCore(IHostEnvironment env, OnnxContextImpl ctx, ITransformer transform, IDataView inputData, String[] outputColumnNamesToKeep)
at Microsoft.ML.OnnxExportExtensions.ConvertToOnnxProtobuf(ModelOperationsCatalog catalog, ITransformer transform, IDataView inputData, String[] outputColumns)
at Microsoft.ML.OnnxExportExtensions.ConvertToOnnx(ModelOperationsCatalog catalog, ITransformer transform, IDataView inputData, Stream stream)
at SentimentAnalysis.Program.ConvertModel2ONNX(MLContext mlContext, ITransformer model, IDataView splitTestSet) in C:\SentimentAnalysis\Program.cs:line 164
at SentimentAnalysis.Program.Main(String[] args) in C:\SentimentAnalysis\Program.cs:line 41
What could be the reason? I do not know if this question has a place here. If not, please forgive me for the inconvenience and ignore my question. Thank you very much.
Hi,
I have been following the tutorial on "Sentiment Analysis" (https://docs.microsoft.com/es-es/dotnet/machine-learning/tutorials/sentiment-analysis), which is really nice, interesting and useful. However, I have stumbled on the first step further. I am trying to export the generated model to onnx with the following code:
mlContext, model and splitDataView come from the functions explainned in the tutorial.
where _onnxPath is the output path for the onnx file.
However, I get the following error.
What could be the reason? I do not know if this question has a place here. If not, please forgive me for the inconvenience and ignore my question. Thank you very much.