xgboost-predictor-java icon indicating copy to clipboard operation
xgboost-predictor-java copied to clipboard

Too long string

Open itmayi opened this issue 6 years ago • 3 comments

when i use XGBoostPredictor load one model to do a test, one exception happenned. How can i sovle it?

Predictor predictor = new Predictor(
                new `java.io.FileInputStream("./model/ransom.pickle"));

Exception in thread "main" java.io.IOException: Too long string: 7887331693998180980 at biz.k11i.xgboost.util.ModelReader.readString(ModelReader.java:185) at biz.k11i.xgboost.Predictor.readParam(Predictor.java:108) at biz.k11i.xgboost.Predictor.(Predictor.java:43) at biz.k11i.xgboost.Predictor.(Predictor.java:26) at HowToUseXgboostPredictor.main(HowToUseXgboostPredictor.java:16)

itmayi avatar Mar 29 '19 14:03 itmayi

Hi, I have the same issue. Did you find out what the problem was ?

ajolivard avatar Jun 05 '19 14:06 ajolivard

I guess u guys save the model with a wrong format.

Predictor seems only accept models saved by booster

if you use sklearn.joblib to save or directly pickle it down, it may cannot be loaded coz its formatting is not acceptable

popfido avatar Aug 22 '19 04:08 popfido

@itmayi Hi, Did you find a workaround?

mahezsh avatar Oct 15 '19 14:10 mahezsh