0

I created a maven program in intellij-idea with openjdk-20, and I put the dependency for nd4j in the dependencies section in pom.xml, and imported nd4j.*, but when I ran the program, it raised this error:

Could not find artifact org.nd4j:nd4j:jar:1.0.0-M2.1 in central (https://repo.maven.apache.org/maven2)

I tried "running the Maven import with -U", which was what the compiler said would fix the error, but it still raised the same error. I also went to the repo.maven.apache.org website, and it didn't have nd4j there.

someone
  • 122
  • 4

1 Answers1

1

I think you are trying to include nd4j dependencies the wrong way. If I am reading the instructions correctly, you are supposed to add the Deeplearning4j dependency:

<dependencies>
  <dependency>
      <groupId>org.deeplearning4j</groupId>
      <artifactId>deeplearning4j-core</artifactId>
      <version>1.0.0-M2.1</version>
  </dependency>
</dependencies>

and a dependency for one of the nd4j backend modules; e.g.

<dependencies>
  <dependency>
      <groupId>org.nd4j</groupId>
      <artifactId>nd4j-native-platform</artifactId>
      <version>1.0.0-M2.1</version>
  </dependency>
</dependencies>

You have apparently used something like this instead:

<dependencies>
  <dependency>
      <groupId>org.nd4j</groupId>
      <artifactId>nd4j</artifactId>
      <version>1.0.0-M2.1</version>
  </dependency>
</dependencies>

That doesn't work because that dependency denotes a parent POM not a JAR file.


I also went to the repo.maven.apache.org website, and it didn't have nd4j there.

It was there when I looked. But as I said, it is a POM file not a JAR file.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Hi, maintainer here. This is correct. You need to pick a backend. nd4j is just a parent artifact and doesn't do anything useful. – Adam Gibson May 21 '23 at 06:07