Closed csharpbd closed 3 years ago
There is no solution yet. There is no converter in onnxmltools for a xgboost booster yet (see https://github.com/onnx/onnxmltools/issues/349).
@xadupre thanks for your reply. I've tried the winmltools
and onnxmltools
but unfortunetly the tools are not working. Already I've posted a question on StackOverflow about it.
You can find the question Error in converting SageMaker XGBoost model to ONNX model
I've tried to explain each steps that I followed to convert the mode to ONNX model. Could you please take a look at the question? I hope you may help me.
winmltools is using onnxmltools. That's why it does not work. I can try to have a fix by the end of the week. Would that work for you?
Sure, that will help me a lot. Thank you for your kindness.
I made a PR: https://github.com/onnx/onnxmltools/pull/355. You need to use onnxmltools from this branch: https://github.com/xadupre/onnxmltools/tree/xgbb. Let me know if it fixes your issue. I still have some doubts because it does not seem possible to retrieve the objective function from a booster. I only guess which kind of problem it is (classifier, regressor) but I might require an extra parameter if it does not work.
@xadupre I'm sorry for late response.
I've tried to convert the model to onnx after installing the xgbb
branch. But I got an error. Actually I'm new in this field, I don't have enough and I'm struggling to get the desired result. Please take a look at the attached image and please guide me, what should I do now.
The PR has been merged. So it should be easier to install. I don't see any error, just a warning we should probably remove. You need to test your model with a runtime now (onnxruntime for example). You should also use None instead of 'None' when you specify the shape.
Thanks @xadupre the model is converted to onnx and I can save the model as .onnx
format. I'm working to check the model using ML.NET. I will back to you after testing the model.
I'll close the issue. Feel free to reopen it.
I'm trying to convert a SageMaker XGBoost model to ONNX. There is a good resource to use machine learning in business area. I've tried Using Machine Learning to Improve Sales in SageMaker to create the model and then convert the model to ONNX model. The example is working well in SageMaker. I've load the model successfully by using
pickle
andjoblib
. But it's shown error, when I'm going to convert the model to onnx usingsklearn-onnx
. Please take a look at the attached images for more details about the error.Could you please take a look at the issues and let me know a way to solve the issues? Thanks in advance!