How do I implement the TensorFrames Spark package on Data Science Experience?

一曲冷凌霜 提交于 2019-12-13 18:05:22

问题


I've been able to import the package:

import pixiedust
pixiedust.installPackage("databricks:tensorframes:0")

But when I try a simple example:

import tensorflow as tf
import tensorframes as tfs
from pyspark.sql import Row
data = [Row(x=[float(x), float(2 * x)],
            key=str(x % 2),
            z = float(x+1)) for x in range(1, 6)]
df = spark.createDataFrame(data)
tfs.print_schema(df)

I get the following error:

...

Py4JJavaError: An error occurred while calling o97.loadClass.
: java.lang.NoClassDefFoundError:com.typesafe.scalalogging.slf4j.LazyLogging

...

I've looked up the issue and it seems like there is an older scala-logging-slf4j artifact in the dependency tree. How do I remove this artifact? Once it's removed, I assume I can add a newer version with PixieDust:

pixiedust.installPackage("https://mvnrepository.com/artifact/com.typesafe.scala-logging/scala-logging-slf4j_2.10/2.1.2") pixiedust.installPackage("https://mvnrepository.com/artifact/com.typesafe.scala-logging/scala-logging-api_2.10/2.1.2")


回答1:


Charles from IBM support helped me find which jars to include:

pixiedust.installPackage("http://central.maven.org/maven2/com/typesafe/scala-logging/scala-logging-slf4j_2.10/2.1.2/scala-logging-slf4j_2.10-2.1.2.jar") pixiedust.installPackage("http://central.maven.org/maven2/com/typesafe/scala-logging/scala-logging-api_2.10/2.1.2/scala-logging-api_2.10-2.1.2.jar")

This technically solves the first error, however TesnsorFrames still aren't working. I'll post another question that is more specific.



来源:https://stackoverflow.com/questions/44120979/how-do-i-implement-the-tensorframes-spark-package-on-data-science-experience

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!