0

Trying to use io.github.ensozos.core.MPdistance.getMPdistance using Maven, I get the following error:

Exception in thread "main" java.lang.NoSuchMethodError:
 'org.nd4j.linalg.api.ndarray.INDArray org.nd4j.linalg.factory.Nd4j.zeros(long, long)'
    at io.github.ensozos.core.MPdistance.getMassDistMatrix(MPdistance.java:116)
    at io.github.ensozos.core.MPdistance.getMPdistance(MPdistance.java:52)
    at Main.Main.main(Main.java:104)

I am using Nd4j version 1.0.0-beta7.

I believe that this is an error related to org.nd4j.linalg.api.ndarray.INDArray not having a zeros(long, long) method. Is there a way to solve the problem?

VLAZ
  • 26,331
  • 9
  • 49
  • 67

1 Answers1

0

I ran mvn dependency:tree on your project and it turns out there were older versions being pulled in:

io.github.ensozos:matrix-profile:jar:0.0.3:compile
[INFO] |  \- org.nd4j:nd4j-native-platform:jar:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:android-arm:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:android-arm64:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:android-x86:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:android-x86_64:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:ios-arm64:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:ios-x86_64:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:linux-x86_64:1.0.0-beta2:compile
[INFO] |     +- org.nd4j:nd4j-native:jar:macosx-x86_64:1.0.0-beta2:compile
[INFO] |     \- org.nd4j:nd4j-native:jar:linux-ppc64le:1.0.0-beta2:compile
[INFO] +- org.nd4j:nd4j-native:jar:1.0.0-beta7:compile
[INFO] |  +- org.nd4j:nd4j-native:jar:windows-x86_64:1.0.0-beta7:compile
[INFO] |  +- org.nd4j:nd4j-native-api:jar:1.0.0-beta7:compile
[INFO] |  \- org.nd4j:nd4j-api:jar:1.0.0-beta7:compile
[INFO] |     \- org.nd4j:protobuf:jar:1.0.0-beta7:compile
[INFO] +- org.datavec:datavec-api:jar:1.0.0-beta7:compile
[INFO] |  +- org.nd4j:jackson:jar:1.0.0-beta7:compile
[INFO] |  \- org.nd4j:nd4j-common:jar:1.0.0-beta7:compile
[INFO] |     \- org.nd4j:guava:jar:1.0.0-beta7:compile
[INFO] \- org.deeplearning4j:deeplearning4j-parallel-wrapper:jar:1.0.0-beta7:compile
[INFO]    +- org.nd4j:nd4j-parameter-server:jar:1.0.0-beta7:compile
[INFO]    |  +- org.nd4j:nd4j-parameter-server-model:jar:1.0.0-beta7:compile
[INFO]    |  \- org.nd4j:nd4j-aeron:jar:1.0.0-beta7:compile
[INFO]    \- org.nd4j:nd4j-parameter-server-client:jar:1.0.0-beta7:compile

(See beta2 vs beta7) I would suggest just taking the source code of this library and updating it. A fork is needed unless the author of the library intends to update the version.

Updating the version that's included with your project won't work because some changes from beta2 to 7 were done that broke the backwards compatibility here.

Adam Gibson
  • 3,055
  • 1
  • 10
  • 12
  • Sorry, not a Java expect. From what I understand, I should fork the repo and update `build.gradle` to use 1.0.0-beta7. What should I do next? – Mihalis Tsoukalos Jul 08 '21 at 14:04
  • You should just need to update the version to beta7 and make sure that the file calls something equivalent. Feel free to post another question if you have issues. It should just be a one line change if that's the only issue. – Adam Gibson Jul 08 '21 at 14:24