ml.dmlc.xgboost4j.java.XGBoostError: [14:43:22] src/metric/elementwise_metric.cc:28: Check failed: (preds.size()) == (info.labels.size()) label and prediction size not match, hint: use merror or mlogloss for multi-class classification

Hot problem!
This exception has a lot of traffic. You can help 15 users by writing a short tip.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by geoHeil
, 1 year ago
[14:43:22] src/metric/elementwise_metric.cc:28: Check failed: (preds.size()) == (info.labels.size()) label and prediction size not match, hint: use merror or mlogloss for multi-class classification
via GitHub by penolove
, 10 months ago
[15:57:17] src/data/data.cc:51: Check failed: (version) == (kVersion) MetaInfo: invalid format
via GitHub by geoHeil
, 2 months ago
[15:57:28] src/objective/regression_obj.cc:41: Check failed: base_score > 0.0f && base_score < 1.0f base_score must be in (0,1) for logistic loss Stack trace returned 2 entries: (0) 0 libxgboost4j5544838633935815740.dylib 0x000000012733ba99
via GitHub by greghor
, 1 year ago
[15:43:58] src/io/local_filesys.cc:154: Check failed: allow_null LocalFileSystem: fail to open "/Users/greghor/anaconda2/lib/python2.7/site-packages/xgboost/jvm-packages/xgboost4j-example/src/main/scala/ml/dmlc/xgboost4j/scala/example/./model/dump.raw.txt"
via GitHub by greghor
, 1 year ago
[09:25:39] src/io/local_filesys.cc:86: LocalFileSystem.ListDirectory ../../demo/data error: No such file or directory
via GitHub by futurecam
, 1 year ago
[21:23:06] src/learner.cc:283: Check failed: ModelInitialized() Always call InitModel or LoadModel before update
ml.dmlc.xgboost4j.java.XGBoostError: [14:43:22] src/metric/elementwise_metric.cc:28: Check failed: (preds.size()) == (info.labels.size()) label and prediction size not match, hint: use merror or mlogloss for multi-class classification
at ml.dmlc.xgboost4j.java.JNIErrorHandle.checkCall(JNIErrorHandle.java:48)
at ml.dmlc.xgboost4j.java.Booster.evalSet(Booster.java:178)
at ml.dmlc.xgboost4j.scala.Booster.evalSet(Booster.scala:97)
at ml.dmlc.xgboost4j.scala.spark.XGBoostModel$$anonfun$1.apply(XGBoostModel.scala:80)
at ml.dmlc.xgboost4j.scala.spark.XGBoostModel$$anonfun$1.apply(XGBoostModel.scala:62)
at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:766)
at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:766)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:319)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:283)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:319)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:283)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
at org.apache.spark.scheduler.Task.run(Task.scala:85)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.