PredictionIO+Universal Recommender快速开发部署推荐引擎的问题总结(2)
1, 对Universal Recommender进行pio build成功,但是却提示No engine found
Building and delpoying model
[INFO] [Engine$] Using command '/home/vagrant/pio_elastic1/PredictionIO-0.11.1-SNAPSHOT/sbt/sbt' at /home/vagrant/workspace/universal-recommender to build.
[INFO] [Engine$] If the path above is incorrect, this process will fail.
[INFO] [Engine$] Uber JAR disabled. Making sure lib/pio-assembly-0.11.-SNAPSHOT.jar is absent.
[INFO] [Engine$] Going to run: /home/vagrant/pio_elastic1/PredictionIO-0.11.-SNAPSHOT/sbt/sbt package assemblyPackageDependency in /home/vagrant/workspace/universal-recommender
[INFO] [Engine$] Compilation finished successfully.
[INFO] [Engine$] Looking for an engine...
[ERROR] [Engine$] No engine found. Your build might have failed. Aborting.
这是Scala版本导致的问题。进入到universal-recommender的打包目录target中查看,会发现一个叫做scala-2.10的目录。
而我们的PredictionIO在make时指定版本是Scala2.11,所以会去scala-2.11目录下去寻找engine的jar包,自然会出现No engine found
这里有个临时的解决方案,就是直接把scala-2.10改名或者拷贝为scala-2.11,就可以让PredictionIO可以正常执行。
[vagrant@master universal-recommender]$ cd /home/vagrant/workspace/universal-recommender/target
[vagrant@master target]$ ls
resolution-cache scala-2.10 streams
[vagrant@master target]$ cp -r scala-2.10 scala-2.11
2,解决Universal Recommender的Scala版本问题
上面的办法只是个临时解决办法,还是需要统一PredictionIO和Universal Recommender的Scala版本。
我们可以通过修改build.sbt来指定Universal Recommender的Scala版本
name := "universal-recommender" scalaVersion := "2.11.8"
但是,最终会发现出现编译错误。原因是Universal Recommender的一些依赖包,没有Scala2.11的版本。比如mahout包。
[vagrant@master universal-recommender]$ pio build
[INFO] [Engine$] Using command '/home/vagrant/pio_elastic1/PredictionIO-0.11.1-SNAPSHOT/sbt/sbt' at /home/vagrant/workspace/universal-recommender to build.
[INFO] [Engine$] If the path above is incorrect, this process will fail.
[INFO] [Engine$] Uber JAR disabled. Making sure lib/pio-assembly-0.11.-SNAPSHOT.jar is absent.
[INFO] [Engine$] Going to run: /home/vagrant/pio_elastic1/PredictionIO-0.11.-SNAPSHOT/sbt/sbt package assemblyPackageDependency in /home/vagrant/workspace/universal-recommender
[ERROR] [Engine$] [error] (*:update) sbt.ResolveException: unresolved dependency: org.apache.mahout#mahout-math-scala_2.;0.13.: not found
[ERROR] [Engine$] [error] unresolved dependency: org.apache.mahout#mahout-spark_2.;0.13.: not found
[ERROR] [Engine$] [error] Total time: s, completed Sep , :: AM
[ERROR] [Engine$] Return code of build command: /home/vagrant/pio_elastic1/PredictionIO-0.11.-SNAPSHOT/sbt/sbt package assemblyPackageDependency is . Aborting.
最终只好对build.sbt动了一下大手术,基本原则是:
1),能够升级到Scala2.11的依赖包,升级;
2),没有2.11的包,比如mahout,强制指定包版本为2.10
3),依赖中出现2.10和2.11并存冲突的包,exclude掉2.10版本
最后修改的样子如下:
import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import sbt.Keys.scalaVersion name := "universal-recommender" version := "0.6.1-SNAPSHOT" organization := "com.actionml" scalaVersion := "2.11.8" val mahoutVersion = "0.13.0" val pioVersion = "0.11.0-incubating" val elasticsearch1Version = "1.7.6" //val elasticsearch5Version = "5.1.2" libraryDependencies ++= Seq(
"org.apache.predictionio" %% "apache-predictionio-core" % pioVersion % "provided",
"org.apache.predictionio" %% "apache-predictionio-data-elasticsearch1" % pioVersion % "provided",
"org.apache.spark" % "spark-core_2.11" % "2.1.0" % "provided",
"org.apache.spark" % "spark-mllib_2.11" % "1.4.0" % "provided",
"org.xerial.snappy" % "snappy-java" % "1.1.1.7",
// Mahout's Spark libs
"org.apache.mahout" % "mahout-math-scala_2.10" % mahoutVersion
exclude("com.github.scopt", "scopt_2.10")
exclude("org.spire-math", "spire_2.10")
exclude("org.scalanlp", "breeze_2.10")
exclude("org.spire-math", "spire-macros_2.10")
exclude("org.apache.spark", "spark-mllib_2.10")
exclude("org.json4s", "json4s-ast_2.10")
exclude("org.json4s", "json4s-core_2.10")
exclude("org.json4s", "json4s-native_2.10")
exclude("org.scalanlp", "breeze-macros_2.10")
exclude("com.esotericsoftware.kryo", "kryo")
exclude("com.twitter", "chill_2.10"),
"org.apache.mahout" % "mahout-spark_2.10" % mahoutVersion
exclude("com.github.scopt", "scopt_2.10")
exclude("org.spire-math", "spire_2.10")
exclude("org.scalanlp", "breeze_2.10")
exclude("org.spire-math", "spire-macros_2.10")
exclude("org.apache.spark", "spark-mllib_2.10")
exclude("org.json4s", "json4s-ast_2.10")
exclude("org.json4s", "json4s-core_2.10")
exclude("org.json4s", "json4s-native_2.10")
exclude("com.twitter", "chill_2.10")
exclude("org.scalanlp", "breeze-macros_2.10")
exclude("com.esotericsoftware.kryo", "kryo")
exclude("org.apache.spark", "spark-launcher_2.10")
exclude("org.apache.spark", "spark-unsafe_2.10")
exclude("org.apache.spark", "spark-tags_2.10")
exclude("org.apache.spark", "spark-core_2.10")
exclude("org.apache.spark", "spark-network-common_2.10")
exclude("org.apache.spark", "spark-streaming_2.10")
exclude("org.apache.spark", "spark-graphx_2.10")
exclude("org.apache.spark", "spark-catalyst_2.10")
exclude("org.apache.spark", "spark-sql_2.10"),
"org.apache.mahout" % "mahout-math" % mahoutVersion,
"org.apache.mahout" % "mahout-hdfs" % mahoutVersion
exclude("com.thoughtworks.xstream", "xstream")
exclude("org.apache.hadoop", "hadoop-client"),
//"org.apache.hbase" % "hbase-client" % "0.98.5-hadoop2" % "provided",
// exclude("org.apache.zookeeper", "zookeeper"),
// other external libs
"com.thoughtworks.xstream" % "xstream" % "1.4.4"
exclude("xmlpull", "xmlpull"),
// possible build for es5
//"org.elasticsearch" %% "elasticsearch-spark-13" % elasticsearch5Version % "provided",
"org.elasticsearch" % "elasticsearch" % "1.7.5" % "provided",
"org.elasticsearch" % "elasticsearch-spark-20_2.11" % "5.5.1",
// exclude("org.apache.spark", "spark-launcher_2.11")
// exclude("org.apache.spark", "spark-unsafe_2.11")
// exclude("org.apache.spark", "spark-tags_2.11")
// exclude("org.apache.spark", "spark-core_2.11")
// exclude("org.apache.spark", "spark-network-common_2.11")
// exclude("org.apache.spark", "spark-streaming_2.11")
// exclude("org.apache.spark", "spark-catalyst_2.11")
// exclude("org.apache.spark", "spark-sql_2.11"),
"org.json4s" % "json4s-native_2.11" % "3.2.10")
.map(_.exclude("org.apache.lucene","lucene-core")).map(_.exclude("org.apache.lucene","lucene-analyzers-common")) resolvers += Resolver.mavenLocal SbtScalariform.scalariformSettings ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(DanglingCloseParenthesis, Prevent)
.setPreference(MultilineScaladocCommentsStartOnFirstLine, true) assemblyMergeStrategy in assembly := {
case "plugin.properties" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last endsWith "package-info.class" =>
MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith "UnusedStubClass.class" =>
MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
PredictionIO和Universal Recommender这样的开源产品,确实存在着官方文档不太完整或者更新不太及时的问题,按照官方手册一次成功的概率很低,需要多次的试验和调查,从其官网,邮件组,以及其他互联网渠道搜索各种线索,才能最终解决问题。
但PredictionIO的社区活跃度很好,Universal Recommender的开发者本人是PredictionIO的重要开发者,还对自己的产品有运营的意愿和行动,邮件组中的技术支持比较到位。
PredictionIO+Universal Recommender快速开发部署推荐引擎的问题总结(2)的更多相关文章
- PredictionIO+Universal Recommender快速开发部署推荐引擎的问题总结(3)
PredictionIO+Universal Recommender虽然可以帮助中小企业快速的搭建部署基于用户行为协同过滤的个性化推荐引擎,单纯从引擎层面来看,开发成本近乎于零,但仍然需要一些前提条件 ...
- PredictionIO+Universal Recommender快速开发部署推荐引擎的问题总结(1)
1,PredictionIO如果用直接下载的0.11.0-incubating版本,存在一个HDFS配置相关的BUG 执行pio status命令时会发生如下的错误: -- ::, ERROR org ...
- SNF快速开发平台--规则引擎整体介绍及使用说明书
一.设计目标 a)规则引擎语法能够满足分单,计费,WMS策略的配置要求.语法是一致和统一的 b)能够在不修改规则引擎模块的情况下,加入任意一个新的规则:实现上述需求之外的规则配置需求 c)运算速度快 ...
- SNF快速开发平台--规则引擎在程序当中如何调用
规则定义完如何在程序当中进行使用呢? 其时很简单,只需要如下代码就可以调用程序: 规则定义: 调用代码: #region 演示2:生成左表数据(规则) POST: /api/DEMO/DemoSing ...
- SNF快速开发平台--规则引擎介绍和使用文档
设计目标: a) 规则引擎语法能够满足分单,计费,WMS策略的配置要求.语法是一致和统一的 b) 能够在不修改规则引擎模块的情况下,加入任意一个新的规则:实现上述需求之外的规则配置需求 c) 运算速度 ...
- Atitit 快速开发的推荐技术标准化 规范 大原则
Atitit 快速开发的推荐技术标准化 规范 大原则 1. 如何评估什么样的技术适合快速开发??1 1.1. (重要)判断语言层次..层次越高开发效率越高 4gl dsl> 3.5gl &g ...
- 使用ASP.NET MVC、Rabbit WeixinSDK和Azure快速开发部署微信后台
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:公众号后台系统和数据都基本准备妥当了,可以来分享下我是如何开发本微信公众号的后台系统了 ...
- 4款java快速开发平台推荐
JBoss Seam JBoss Seam,算得上是Java开源框架里面最优秀的快速开发框架之一. Seam框架非常出色,尤其是他的组件机制设计的很有匠心,真不愧是Gavin King精心打造的框架了 ...
- UWP简单示例(三):快速开发2D游戏引擎
准备 IDE:VisualStudio 2015 Language:VB.NET/C# 图形API:Win2D MSDN教程:UWP游戏开发 游戏开发涉及哪些技术? 游戏开发是一门复杂的艺术,编码方面 ...
随机推荐
- 用JS实现Ajax请求
AJAX核心(XMLHttpRequest) 其实AJAX就是在Javascript中多添加了一个对象:XMLHttpRequest对象.所有的异步交互都是使用XMLHttpServlet对象完成的. ...
- HDU5804--Price List
Price List Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) Tot ...
- JavaSE初步学习笔记
PS:个人用来随时记录学习的过程,格式比较混乱,仅供个人参考与复习知识点 Dos命令行,课程中常见的命令 Dir:列出当前目录下包含的文件 Md:在当前目录下创建文件 Rd:在当前目录下删除指定文件夹 ...
- 浅谈Android中Serializable和Parcelable使用区别
版权声明:本文出自汪磊的博客,转载请务必注明出处. 一.概述 Android开发的时候,我们时长遇到传递对象的需求,但是我们无法将对象的引用传给Activity或者Fragment,我们需要将这些对象 ...
- win10下Python3.6安装、配置以及pip安装包教程
0.目录 1.前言 2.安装python 3.使用pip下载.安装包 3.1 安装Scrapy 3.2 安装PyQt 3.3 同时安装多个包 3.4 pip的常用命令 1.前言 之前在电脑上安装了py ...
- 【NOI2015】程序自动分析
https://www.luogu.org/problem/show?pid=1955 并查集+离散化. 先执行所有x=y问题,即合并x和y. 再依次执行所有x!=y问题,即查询x和y是否处于同一集合 ...
- java学习笔记IO之字节输入输出流
IO字节输入输出流 OutputStream:字节输出流 该抽象类是所有字节输出流的超类: 定义了一些共性的成员方法: 1.写入一个字节 void write(int b);//b表示字节 2.写入字 ...
- 》》ajax加蒙版
在与后台交互时,用时过长.禁止页面操作等,有提示,增强页面体验: $.ajax({ type:'POST',url:url,data:obj,dataType:'json',beforeSend: f ...
- JS 循环遍历JSON数据 分类: JS技术 JS JQuery 2010-12-01 13:56 43646人阅读 评论(5) 收藏 举报 jsonc JSON数据如:{"options":"[{
JS 循环遍历JSON数据 分类: JS技术 JS JQuery2010-12-01 13:56 43646人阅读 评论(5) 收藏 举报 jsonc JSON数据如:{"options&q ...
- Explicit Semantic Analysis (ESA)
有别于LSA (Latent Semantic Analysis), 下列文章提出一种ESA (Explicit Semantic Analysis), 并介绍怎样使用ESA来进行语义相关性和文本分类 ...