onnx / onnxmltools

ONNXMLTools enables conversion of models to ONNX
https://onnx.ai
Apache License 2.0
1.02k stars 183 forks source link

ValueError: could not convert string to float: 'xxx' #533

Open larawehbe opened 2 years ago

larawehbe commented 2 years ago

Hi Im trying to convert XGBoost model to onnx using onnxmltools.convert versions used : onnxmltools 1.10.0 onnxconverter-common 1.9.0

OS: Ubuntu

The XGB model is trained using XGB booster, and input of the training model is Pandas Dataframe, added in DMatrix The example is very close to the one in the documentation below https://onnx.ai/sklearn-onnx/auto_tutorial/plot_gexternal_xgboost.html#same-with-a-booster

Its always raising the error ValueError: could not convert string to float: 'column_name' what's the issue here?

Any help is appreciated Thanks

chansonZ commented 2 years ago

It may be a bug.

  1. bypassed it by rename feature name to 'f%d' for example : f1,f2...fn

2.load binary xgb model