【问题标题】:Converting XGBoost model to CoreML将 XGBoost 模型转换为 CoreML
【发布时间】:2017-12-09 11:22:42
【问题描述】:

我正在尝试将以下 XGBoost 模型转换为 CoreML 文件,但出现错误。

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-
  packages/coremltools/converters/xgboost/_tree.py", line 48, in convert
return _MLModel(_convert_tree_ensemble(model, feature_names, target))
File "/usr/local/lib/python2.7/dist-
 packages/coremltools/converters/xgboost/_tree_ensemble.py", line 111, in convert_tree_ensemble
xgb_model_str = model.get_dump(with_stats=True, dump_format = 'json')
TypeError: get_dump() got an unexpected keyword argument 'dump_format'

我使用 pip 安装了 xgboost。为什么会出现这种情况?

【问题讨论】:

标签: python ios xgboost coreml


【解决方案1】:

我有 xgboost 0.61 的版本,然后我移到了 0.81,这解决了我的问题。

【讨论】:

    【解决方案2】:

    按照安装指南进行操作。不要使用 pip install xgboost 否则你会在 get_dump 中得到这个错误。请参阅http://xgboost.readthedocs.io/en/latest/build.html 了解更多信息。

    【讨论】:

      猜你喜欢
      • 2018-06-11
      • 2017-11-23
      • 2020-08-25
      • 2018-09-12
      • 2019-10-18
      • 2020-01-24
      • 2022-01-11
      • 2023-03-03
      • 2017-11-12
      相关资源
      最近更新 更多