mleap icon indicating copy to clipboard operation
mleap copied to clipboard

Cloud not load xgboost model into spring boot service

Open BDon-Tan opened this issue 4 years ago • 4 comments

hi, I have serialized a xgboost-spark pipeline model in bundle format, but I could not load it into spring boot service because of "xgboost.classifier" op is not supported. I found that mleap-xgboost-runtime is released now. It seems loading xgboost-spark pipeline should be accessible. Would you help me about how to add dependency of mleap-xgboost-runtime into mleap-spring-boot ? Or update the docker with xgboost model support?

BDon-Tan avatar Oct 17 '21 12:10 BDon-Tan

I think this should be a matter of adding mleap-xgboost-runtime into your jvm dependency management system? I.e., add it as a dependency in your pom.xml, build.sbt, or build.gradle file depending on which build system you are using.

jsleight avatar Oct 25 '21 22:10 jsleight

hi, I have add it as a dependency in our build.sbt, but it does not work, project mleap-runtime build.sbt:

import ml.combust.mleap.{Dependencies, Common} Common.defaultMleapSettings Common.defaultMleapXgboostSparkSettings Dependencies.runtime(scalaVersion)

The error is “Exception in thread "main" java.util.NoSuchElementException: key not found: xgboost.classifier at scala.collection.MapLike.default(MapLike.scala:235)”

zgcheng82725411 avatar Dec 29 '21 03:12 zgcheng82725411

hi, I have add it as a dependency in our build.sbt, but it does not work, project mleap-runtime build.sbt:

import ml.combust.mleap.{Dependencies, Common} Common.defaultMleapSettings Common.defaultMleapXgboostSparkSettings Dependencies.runtime(scalaVersion)

The error is “Exception in thread "main" java.util.NoSuchElementException: key not found: xgboost.classifier at scala.collection.MapLike.default(MapLike.scala:235)”

zgcheng82725411 avatar Dec 29 '21 03:12 zgcheng82725411

Can you provide a more complete stacktrace?

My only thought right now is that the mleap runtime can't find the correct op used to load the bundle. This could occur if you have a resources.conf file in your project and aren't having mleap's reference.conf appended to your project's reference.conf. E.g., if you are using sbt-assembly plugin, then you might need

assemblyMergeStrategy in assembly := {
  case "reference.conf" => MergeStrategy.concat
  case _ => MergeStrategy.first
}

But a complete stacktrace will help to confirm/deny this.

jsleight avatar Jan 04 '22 16:01 jsleight