question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem creating onnx file from XGBRanker

See original GitHub issue

Hey team. I am receiving this:

ValueError: No proper operator name found for '<class 'xgboost.core.Booster'>'

when trying to serialize a ranking model from xgb.

I train my data using

xgb.train({"objective":"rank:ndcg", "max_depth": 9}, train_xgb)

Maybe the rank objectives behave differently?

Looks like XGBRanker and Booster are missing from xgboost_operator_name_map https://github.com/onnx/onnxmltools/blob/master/onnxmltools/convert/xgboost/_parse.py#L16

Since the ranking model outputs a single number, my intuition says serializing it would be similar to an XGBRegressor

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
xaduprecommented, Apr 21, 2020

You are free to contribute. The first task is to know whether or not the ranker can be modelled with onnx operators and then to modify the code to update the conversion (in this folder: https://github.com/onnx/onnxmltools/tree/master/onnxmltools/convert/xgboost).

0reactions
horieecommented, Aug 31, 2022

has it been resolved or suggested to use the workaround? @sa- @xadupre thx

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in converting SageMaker XGBoost model to ONNX model
I'm trying to convert a SageMaker XGBoost model to ONNX, in order to use the ONNX model in .Net application using ML.NET.
Read more >
Ranking with XGBoost Models - Vespa Documentation
Known issues. When dumping XGBoost models to a JSON representation some of the model information is lost (e.g. the base_score or the optimal...
Read more >
Convert a pipeline with a XGBoost model - ONNX
sklearn-onnx only converts scikit-learn models into ONNX but many libraries implement scikit-learn API so that their models can be included in a scikit-learn ......
Read more >
ONNX — Made Easy - Towards Data Science
Essentially ONNX tackles this problem by it giving the guarantee that ... You can create a model using almost any AI tool, the...
Read more >
Creating and Modifying ONNX Model Using ONNX Python API
Creating ONNX Model. To better understand the ONNX protocol buffers, let's create a dummy convolutional classification neural network, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found