How to find missing dependencies

Hi,

I’m practicing how to build my own projects with maven in a linux computer. I used the MnistClassifier code provided in the examples. I created a project in my computer typing

mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart

then modified the pom.xml file to include the dependencies deeplearning4j, datavec and nd4j as specified in https://www.dubs.tech/guides/maven-essentials/.

After compiling (typed mvn package), I got two errors:

package org.deeplearning4j.examples.utilities does not exist
package org.nd4j.evaluation.classification does not exist

The first one is part of the deeplearning4j examples, but the second one is not. I looked for both of these packages in the maven repository, but none of them were there.

Please advice how/where to find these dependencies.

Best,

Gabriel

Note the age of the article. The examples there are using quite an old version of DL4J. The current version is beta6.

Thanks for the note.

This is the pom.xml contents of my package:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>iron.dl4j</groupId>
  <artifactId>trial1-project</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>trial1-project</name>
  <url>http://maven.apache.org</url>

  <properties>
    <dl4j.version>1.0.0-beta</dl4j.version>
    <java.version>1.8</java.version>
    <nd4j.version>1.0.0-beta6</nd4j.version>
    <dl4j.version>1.0.0-beta6</dl4j.version>
    <datavec.version>1.0.0-beta6</datavec.version>
    <arbiter.version>1.0.0-beta6</arbiter.version>
    <rl4j.version>1.0.0-beta6</rl4j.version>
  </properties>


  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.deeplearning4j</groupId>
      <artifactId>deeplearning4j-core</artifactId>
      <version>${dl4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.datavec</groupId>
      <artifactId>datavec-api</artifactId>
      <version>${dl4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.nd4j</groupId>
      <artifactId>nd4j-native-platform</artifactId>
      <version>${dl4j.version}</version>
    </dependency>
  </dependencies>

If I understand correctly, I’m specifying the 1.0.0beta6 version.

What is your opinion about this error?

Gabriel

Ooops, it seems the editor translate some of the pom tags…I’m copying again the pom.xml contents:

<<>>
<<>>4.0.0<<>>
<<>>iron.dl4j<<>>
<<>>trial1-project<<
<<>>jar<<>>
<<>>1.0-SNAPSHOT<<
<<>>trial1-project<<>>
<<>>http://maven.apache.org<<>>

<<>>
<<<dl4j.version>>>1.0.0-beta<<</dl4j.version>>>
<<<java.version>>>1.8<<</java.version>>>
<<<nd4j.version>>>1.0.0-beta6<<</nd4j.version>>>
<<<dl4j.version>>>1.0.0-beta6<<</dl4j.version>>>
<<<datavec.version>>>1.0.0-beta6<<</datavec.version>>>
<<<arbiter.version>>>1.0.0-beta6<<</arbiter.version>>>
<<<rl4j.version>1.0.0-beta6</rl4j.version>>>
<<>>

<<>>
<<>>
<<>>junit<<>>
<<junit>>
<<4.12>>
<<test>>
<<>>
<<>>
<<>>org.deeplearning4j<<>>
<<>>deeplearning4j-core<<>>
<<>>{dl4j.version}<<</version>>> <<</dependency>>> <<<dependency>>> <<<groupId>>>org.datavec<<</groupId>>> <<<artifactId>>>datavec-api<<</artifactId>>> <<<version>>>{dl4j.version}<<>>
<<>>
<<>>
<<>>org.nd4j<<>>
<<>>nd4j-native-platform<<>>
<<>>${dl4j.version}<<>>
<<>>
<<>>

You need to make sure all the projects in the DL4J ecosystem refer to the same version. In what you posted above you have:

<<<dl4j.version>>>1.0.0-beta<<</dl4j.version>>>
That should be beta6 as well. Like the rest.

Thanks! I fixed that typo but that did not solve the problem.

I’ve tried to add different dependencies, but none has solved this issue. I found a repo for deeplearning4j-examples at https://mvnrepository.com/artifact/org.deeplearning4j/deeplearning4j-examples, but that included version 0.0.3.1, so, even this addition allowed maven to progress more than without that dependency, it end up producing the same compiling error.

I believe I need to add a dependency for a maven repository that includes the deeplearning4j-examples. I’ve looked one for the 1.0.0-beta6 version in maven repository without luck. I have the class file created in my local dir for the missing class, so I can look on how to add a class in a maven compilation.

Let me know what do you propose.

Gabriel

Some of the things that are used in examples, are meant to be just used in the examples. So you shouldn’t be using them outside of them.

If you absolutely still want to do that for learning purposes, you can install the examples into your local maven repository.

However, I advise you to not do that, if you want to use them, do that inside the examples project instead.

Thanks, that is a good advice. This problem helped me to learned other stuff about maven. Thanks for the assistance.

Gabriel