You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently having issues with exporting and importing an XGBoost model to/from a Stream. I export the model to a ByteArrayOutputStream with the saveModel method on ml.dmlc.xgboost4j.java.Booster :
Altough the Stream contains the exact same data the import fails with the following exception:
Caused by: ml.dmlc.xgboost4j.java.XGBoostError: [16:24:54] D:\a\xgboost\xgboost\src\learner.cc:785: Check failed: fi->Read(&tparam_.objective): BoostLearner: wrong model format
at ml.dmlc.xgboost4j.java.XGBoostJNI.checkCall(XGBoostJNI.java:48)
at ml.dmlc.xgboost4j.java.Booster.loadModel(Booster.java:81)
at ml.dmlc.xgboost4j.java.XGBoost.loadModel(XGBoost.java:64)
...
I recently upgraded from version 1.3.1 to 1.4.1. I never encountered this problem with version 1.3.1. I noticed an entry in the changelog mentioning changes to the export/importing of models ([jvm] Add ability to load booster direct from byte array (#6655)). Might i be using the new API wrong?
Library version: XGBoost4J 1.4.1
The text was updated successfully, but these errors were encountered:
PossessedC0bra
changed the title
Exporting to, then importing a model from stream results in wrong model format exception
XGBoost4J: Exporting to, then importing a model from stream results in wrong model format exception
Aug 11, 2021
Hi there!
I'm currently having issues with exporting and importing an XGBoost model to/from a Stream. I export the model to a
ByteArrayOutputStream
with thesaveModel
method onml.dmlc.xgboost4j.java.Booster
:xgboost/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/Booster.java
Lines 393 to 396 in 3f38d98
At a later point i try to import the previously exported model again from an
InputStream
using theloadModel
method onml.dmlc.xgboost4j.java.XGBoost
:xgboost/jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/XGBoost.java
Lines 56 to 65 in 3f38d98
Altough the Stream contains the exact same data the import fails with the following exception:
I recently upgraded from version 1.3.1 to 1.4.1. I never encountered this problem with version 1.3.1. I noticed an entry in the changelog mentioning changes to the export/importing of models ([jvm] Add ability to load booster direct from byte array (#6655)). Might i be using the new API wrong?
Library version: XGBoost4J 1.4.1
The text was updated successfully, but these errors were encountered: