Closed jcmontoya closed 4 years ago
@jcmontoya have you checked whether all steps in the pipeline are convertible to ONNX as the meesage says?
@wschin do you have any input here as to why this might be happening?
@jcmontoya It is our goal to make all of ML.NET estimators convertible to Onnx but we are not there yet. Right now, only (approximately) half of the estimators can be exported to Onnx.
If you go to the documentation page of any estimator (e.g. ColumnConcatenatingEstimator )you should be able to see a line as follows in the Estimator characteristics table that will let let you know whether that estimator can be exported to onnx:
Exportable to ONNX | Yes
Also, the bulk of onnx related work didn't make it v1.4. Can you please try out your code v1.5 preview builds and reopen the bug if you still see this issue?
Hi, same problem here. Any news on making the ImageLoadingEstimator exportable to ONNX?
System Information (please complete the following information):
Describe the bug I used the Model Builder to Classify basketball balls and soccer balls. It works very well. then I tried to convert the generated model to ONNX using the code bellow: ` string modelPath = AppDomain.CurrentDomain.BaseDirectory + "MLModel.zip";
ITransformer mlModel = mLContext.Model.Load(modelPath, out var modelInputSchema);
IDataView dataView = mLContext.Data.LoadFromTextFile(
path: DATA_FILEPATH,
hasHeader: true,
separatorChar: '\t',
allowQuoting: true,
allowSparse: false);
MemoryStream memoryStream = new MemoryStream();
mLContext.Model.ConvertToOnnx(mlModel, dataView, memoryStream);
byte[] data = memoryStream.ToArray();
using (FileStream fileStream = File.Create(@"C:\temp\SportsBall.onnx")) { fileStream.Write(data, 0, data.Length); } ` In the Bold line I get the following error:
System.InvalidOperationException: 'The targeted pipeline can not be fully converted into a well-defined ONNX model. Please check if all steps in that pipeline are convertible to ONNX and all necessary variables are not dropped (via command line arguments).'
To Reproduce Steps to reproduce the behavior:
Expected behavior The new ONNX model should be generated in the path: C:\temp\SportsBall.onnx
Screenshots NA
Additional context NA