Reputation: 671
I created a pipeline in Azure ML that trains a model using Boosted Decision Tree Regression. From my understanding, the model is saved as data.ilearner
.
However, I am unable to convert this model into a model.pkl
format that can be loaded using joblib
.
model.pkl
file in Azure ML for a Boosted Decision Tree Regression model?data.ilearner
to model.pkl
?I attempted to use the following Python script to load and convert the model:
import lightgbm as lgb
import joblib
# Load the LightGBM model
model = lgb.Booster(model_file="data.ilearner")
# Save as a Pickle file
joblib.dump(model, "model.pkl")
But when running the script, I get the following error:
% python3 convert_to_model_pkl.py
[LightGBM] [Fatal] Unknown model format or submodel type in model file data.ilearner
Traceback (most recent call last):
File "/Users/tomasz.olchawa/ng/ml/convert_to_model_pkl.py", line 5, in <module>
model = lgb.Booster(model_file="data.ilearner")
File "/Users/tomasz.olchawa/ng/ml/myenv/lib/python3.13/site-packages/lightgbm/basic.py", line 3697, in __init__
_safe_call(
~~~~~~~~~~^
_LIB.LGBM_BoosterCreateFromModelfile(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
)
^
File "/Users/../ng/ml/myenv/lib/python3.13/site-packages/lightgbm/basic.py", line 313, in _safe_call
raise LightGBMError(_LIB.LGBM_GetLastError().decode("utf-8"))
lightgbm.basic.LightGBMError: Unknown model format or submodel type in model file data.ilearner
Upvotes: 0
Views: 37