Build file for deeplearning4j


(rtayek) #1

the hint here says:

You can use Deeplearning4j with Gradle by adding the following to your build.gradle in the dependencies block:

provided “org.deeplearning4j:deeplearning4j-core:${FIND THE VERSION FROM OUR EXAMPLES http://github.com/deeplearning4j/dl4j-examples}”

putting: provided "org.deeplearning4j:deeplearning4j-core:‘0.9.1’"
into the dependencies causes gradle to say:

Could not find method provided() for arguments [org.deeplearning4j:deeplearnin
g4j-core:‘0.9.1’] on object of type org.gradle.api.internal.artifacts.dsl.depend
encies.DefaultDependencyHandler.

does anyone have a build file that will work?

thanks


(James Justinic) #2

There is not a configuration called provided in Gradle unless you explicitly define one and configure it. However, it doesn’t even make sense that this dependency would be “provided” in the build tools that have this configuration by default. The other build tool examples are adding this to compile / their equivalent, so it seems the author of the hint was just confused.

The hint should probably read:

compile 'org.deeplearning4j:deeplearning4j-core:0.9.1'

(rtayek) #3

wonderful, i got clean compile with a reference to a core object.

thanks


(James Justinic) #4

Additionally, there was a deeplearning4j issue filed on GitHub for this back in 2016, but the reporter didn’t create a pull request as requested by a maintainer. I created the pull request and it was already merged, so the documentation will not mislead any future Gradle users.


(rtayek) #5

i got my build file (please see below) to compile all of the examples.

apply plugin: 'java’
apply plugin: 'eclipse’
apply plugin: 'application’
repositories {
jcenter()
mavenCentral()
}
mainClassName="Main"
dependencies {
compile 'org.deeplearning4j:dl4j-spark_2.11:0.9.1_spark_1’
compile 'org.nd4j:nd4j-native-platform:0.9.1’
compile group: ‘org.deeplearning4j’, name: ‘deeplearning4j-ui_2.11’, version: '0.9.1’
compile group: ‘org.deeplearning4j’, name: ‘arbiter-deeplearning4j’, version: '0.9.1’
compile group: ‘org.deeplearning4j’, name: ‘arbiter-ui_2.11’, version: '0.9.1’
compile group: ‘org.deeplearning4j’, name: ‘deeplearning4j-zoo’, version: '0.9.1’
compile group: ‘org.deeplearning4j’, name: ‘deeplearning4j-parallel-wrapper_2.11’, version: '0.9.1’
compile group: ‘org.jfree’, name: ‘jfreechart’, version: ‘1.0.14’ //13 not found
compile group: ‘org.jfree’, name: ‘jcommon’, version: '1.0.23’
compile group: ‘org.datavec’, name: ‘datavec-data-codec’, version: '0.9.1’
compile 'org.slf4j:slf4j-api:1.7.21’
testCompile ‘junit:junit:4.12’
}