5

I want to run the LSTM code from deeplearning4j examples in my own sbt project using scala. My setup is Ubuntu 14.04, sbt 0.13, Oracle Java 8, nd4j version 0.5.0, scala 2.11.8. My approach can be found in my git repo. Feel free to clone it. On runtime I get the following warnings and errors. How can I fix this?

Sebastian
  • 281
  • 1
  • 8
  • Are you sure that you have all necessary dependencies? The error says that something is missing on the classpath. – sebszyller Aug 23 '16 at 15:18
  • I followed the instructions on http://nd4j.org/getstarted.html, but could not find a setup that works solely with SBT. The original deeplearning4j example project is working. But it uses Maven. Analyzing the dependencies on both projects using IntelliJ did not show any differences. – Sebastian Aug 23 '16 at 15:43
  • See this -> https://github.com/kogecoo/dl4j-examples-scala – sarveshseri Aug 23 '16 at 17:37
  • Hi, If you don't see it under github.com/deeplearning4j don't trust what you see there. Often times that stuff is unmaintained and HUGELY out of date – Adam Gibson Aug 24 '16 at 00:02

4 Answers4

1

Just look at the nd4s build.sbt: https://github.com/deeplearning4j/nd4s/blob/master/build.sbt

Adam Gibson
  • 3,055
  • 1
  • 10
  • 12
  • 1
    It uses the local maven repo of the user. – Sebastian Aug 24 '16 at 09:13
  • The dependencies declarations still apply though. – Adam Gibson Aug 24 '16 at 09:15
  • Cloning https://github.com/deeplearning4j/nd4s and following installation instructions results in a sbt.ResolveException for 'nd4j-native' package jar. – Sebastian Aug 24 '16 at 09:29
  • You should be using nd4j-native-platform for the artifact id (btw if you're still having problems the live chat suggested above will be easier for both of us) Try following the nd4j.org/getstarted.html if this isn't working Most of our users have had it work. – Adam Gibson Aug 24 '16 at 10:43
1

Possibly due to a bug in SBT some internal variables are currently not resolved causing the resolution of the dependency 'nd4j-native-package' to fail. As a workaround you can use the following dependency declaration for nd4j:

libraryDependencies ++= Seq(
  "org.nd4j" % "nd4j-native" % "0.5.0" classifier "$platform",
  "org.nd4j" % "nd4j-native" % "0.5.0"
)

For a comprehensive list which platform strings are supported see http://nd4j.org/dependencies.html

Hope it helps.

Sebastian
  • 281
  • 1
  • 8
  • Could you please update the link http://nd4j.org/dependencies.html? It is redirecting to https://deeplearning4j.org/docs/latest/nd4j-overview and I can't find a word about platform strings there. – bugfoot Nov 03 '18 at 12:38
0

If you have the Coursier plugin enabled in sbt and see errors like:

coursier.ResolutionException: 1 not found
  https://repo1.maven.org/maven2/org/nd4j/nd4j-native/0.5.0/nd4j-native-0.5.0-${os.name}-${os.arch}.${project.packaging}
[error] (*:update) coursier.ResolutionException: 1 not found
[error]   https://repo1.maven.org/maven2/org/nd4j/nd4j-native/0.5.0/nd4j-native-0.5.0-${os.name}-${os.arch}.${project.packaging}

You'll want to disable it or get a version that contains the fix for alexarchambault/coursier#341

Kevin
  • 313
  • 2
  • 12
-1

Can you join the Deeplearning4j/ND4J community on Gitter? Someone will answer your questions there... https://gitter.im/deeplearning4j/deeplearning4j

racknuf
  • 444
  • 3
  • 12