onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.39k stars 629 forks source link

Issues in loading Sklearn's SVC model in scala/Java with ONXX #249

Closed aakashveera closed 2 years ago

aakashveera commented 3 years ago

For a demonstration of this issue, I have used IRIS as the data. I have created models for IRIS data with sklearn's Randomforest, Logistic Regression and SVC and dumped all three using onxx library. Now while accessing the onxx models in scala the RF model and logistic-reg model works as expected

image

Now while loading the SVC model trained and dumped in the same way it is giving some weird output as shown in the image and couldn't able to parse the results.

image

(usually this happens when we print a java array. But this isn't a java array. Indexing causes error)

Initally had issues in saving svc model. Referred https://github.com/onnx/sklearn-onnx/issues/302 and was able to save the model. But now I am getting errors in parsing the output only in scala/Java. while loading the saved onnx model in Python the results were good as expected.

jcwchen commented 2 years ago

It seems unrelated to ONNX Model Zoo and I think you got an answer from other repo. Close here now. Thanks!