apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.75k stars 6.8k forks source link

Scala runtime issues for mxnet #20733

Open lion241 opened 2 years ago

lion241 commented 2 years ago

Description

I am trying to use MXnet in scala, there are no clear instructions on the issue of installation and running something simple.

Error Message

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" java.lang.UnsatisfiedLinkError: Couldn't find the resource libmxnet-scala.jnilib at ml.dmlc.mxnet.util.NativeLibraryLoader$.loadLibrary(NativeLibraryLoader.scala:90) at ml.dmlc.mxnet.Base$.(Base.scala:70) at ml.dmlc.mxnet.Base$.(Base.scala) at ml.dmlc.mxnet.NDArray$.initNDArrayModule(NDArray.scala:151) at ml.dmlc.mxnet.NDArray$.(NDArray.scala:38) at ml.dmlc.mxnet.NDArray$.(NDArray.scala) at TrainMnist$.main(TrainMnist.scala:70) at TrainMnist.main(TrainMnist.scala)

To Reproduce

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

Steps to reproduce

(Paste the commands you ran that produced the error.)

import ml.dmlc.mxnet._

object test {

val arr = NDArray.ones(2, 3)

print(arr)

}

What have you tried to solve it?

I am a bit new in scala but the website maven installation did not manage to load the package.

when i tried to add the archtype , nothing was added . I got stuck at :

GroupId net.alchim31.maven ArtifactId scala-archetype-simple Version 1.6 Repository https://mvnrepository.com/artifact/net.alchim31.maven/scala-archetype-simple

I tried to using sbt but it claims package is not found as a build error : libraryDependencies += "org.apache.mxnet" % "mxnet-full_2.11-osx-x86_64-cpu" % "1.5.0"

This one seems to work: libraryDependencies += "ml.dmlc.mxnet" %% "mxnet-core" % "0.9.3a"

Environment

sbt=1.1.6 scalaVersion := "2.11.12" Java 8

Environment Information ``` # Paste the diagnose.py command output here ```
github-actions[bot] commented 2 years ago

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.