You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/05 09:14:17 UTC

[GitHub] dytmh opened a new issue #9992: mxnet scala example run error

dytmh opened a new issue #9992: mxnet scala example run error
URL: https://github.com/apache/incubator-mxnet/issues/9992
 
 
   Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.
   
   For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io 
   
   ## Description
   http://mxnet.incubator.apache.org/tutorials/scala/mnist.html
   3-layer network, run example error
   
   ## Environment info (Required)
   ----------Python Info----------
   Version      : 3.6.2
   Compiler     : GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)
   Build        : ('default', 'Jul 20 2017 13:14:59')
   Arch         : ('64bit', '')
   ------------Pip Info-----------
   Version      : 9.0.1
   Directory    : /Users/dyt/miniconda2/envs/gluon/lib/python3.6/site-packages/pip
   ----------MXNet Info-----------
   Version      : 1.2.0
   Directory    : /Users/dyt/miniconda2/envs/gluon/lib/python3.6/site-packages/mxnet
   Commit Hash   : 94d9043569299b0024e60d2ac106ea1324319292
   ----------System Info----------
   Platform     : Darwin-17.4.0-x86_64-i386-64bit
   system       : Darwin
   node         : blove-MacBook-Pro.local
   release      : 17.4.0
   version      : Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64
   ----------Hardware Info----------
   machine      : x86_64
   processor    : i386
   b'machdep.cpu.brand_string: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz'
   b'machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC POPCNT AES PCID XSAVE OSXSAVE TSCTMR AVX1.0 RDRAND F16C'
   b'machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS'
   b'machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF RDTSCP TSCI'
   ----------Network Test----------
   Setting timeout: 10
   Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0027 sec, LOAD: 1.7296 sec.
   Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0011 sec, LOAD: 0.3721 sec.
   Error open Gluon Tutorial(cn): https://zh.gluon.ai, <urlopen error [Errno 54] Connection reset by peer>, DNS finished in 0.0013082027435302734 sec.
   Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0006 sec, LOAD: 1.4233 sec.
   Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0008 sec, LOAD: 0.8117 sec.
   Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0008 sec, LOAD: 0.7722 sec.
   
   Package used (Python/R/Scala/Julia):
   I'm using Scala
   
   java version "1.8.0_162"
   Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
   Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
   
   Scala code runner version 2.12.4 -- Copyright 2002-2017, LAMP/EPFL and Lightbend, Inc.
   
   OS: Mac OS 10.13.3 (17D102)
   SBT: 1.1.1
   MxNet:"ml.dmlc.mxnet" % "mxnet-full_2.11-osx-x86_64-cpu" % "v0.11.1a"
   
   ## Build info (Required if built from source)
   
   Compiler (gcc/clang/mingw/visual studio):
   IntelliJ IDEA CE
   
   ## Error Message:
   [17:01:44] src/io/iter_mnist.cc:112: MNISTIter: load 60000 images, shuffle=1, shape=(50,1,28,28)
   [17:01:44] src/io/iter_mnist.cc:112: MNISTIter: load 10000 images, shuffle=1, shape=(50,1,28,28)
   [error] (run-main-e) java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
   [error] java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
   [error] 	at ml.dmlc.mxnet.Symbol.attrMap(Symbol.scala:358)
   [error] 	at ml.dmlc.mxnet.Optimizer.setSymbol(Optimizer.scala:224)
   [error] 	at ml.dmlc.mxnet.FeedForward.fit(FeedForward.scala:354)
   [error] 	at ml.dmlc.mxnet.FeedForward.fit(FeedForward.scala:270)
   [error] 	at ml.dmlc.mxnet.FeedForward$Builder.build(FeedForward.scala:665)
   [error] 	at main$.delayedEndpoint$main$1(main.scala:124)
   [error] 	at main$delayedInit$body.apply(main.scala:8)
   [error] 	at scala.Function0.apply$mcV$sp(Function0.scala:34)
   [error] 	at scala.Function0.apply$mcV$sp$(Function0.scala:34)
   [error] 	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
   [error] 	at scala.App.$anonfun$main$1$adapted(App.scala:76)
   [error] 	at scala.collection.immutable.List.foreach(List.scala:389)
   [error] 	at scala.App.main(App.scala:76)
   [error] 	at scala.App.main$(App.scala:74)
   [error] 	at main$.main(main.scala:8)
   [error] 	at main.main(main.scala)
   [error] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [error] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   [error] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [error] 	at java.lang.reflect.Method.invoke(Method.java:498)
   [error] 	at sbt.Run.invokeMain(Run.scala:93)
   [error] 	at sbt.Run.run0(Run.scala:87)
   [error] 	at sbt.Run.execute$1(Run.scala:65)
   [error] 	at sbt.Run.$anonfun$run$4(Run.scala:77)
   [error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
   [error] 	at sbt.util.InterfaceUtil$$anon$1.get(InterfaceUtil.scala:10)
   [error] 	at sbt.TrapExit$App.run(TrapExit.scala:252)
   [error] 	at java.lang.Thread.run(Thread.java:748)
   
   ## Minimum reproducible example
   
    import ml.dmlc.mxnet._
    import ml.dmlc.mxnet.optimizer.SGD
   
     // model definition
     val data = Symbol.Variable("data")
     val fc1 = Symbol.FullyConnected(name = "fc1")()(Map("data" -> data, "num_hidden" -> 128))
     val act1 = Symbol.Activation(name = "relu1")()(Map("data" -> fc1, "act_type" -> "relu"))
     val fc2 = Symbol.FullyConnected(name = "fc2")()(Map("data" -> act1, "num_hidden" -> 64))
     val act2 = Symbol.Activation(name = "relu2")()(Map("data" -> fc2, "act_type" -> "relu"))
     val fc3 = Symbol.FullyConnected(name = "fc3")()(Map("data" -> act2, "num_hidden" -> 10))
     val mlp = Symbol.SoftmaxOutput(name = "sm")()(Map("data" -> fc3))
   
     // load MNIST dataset
     val trainDataIter = IO.MNISTIter(Map(
       "image" -> "/Users/dyt/work/mxnet/train-images-idx3-ubyte",
       "label" -> "/Users/dyt/work/mxnet/train-labels-idx1-ubyte",
       "data_shape" -> "(1, 28, 28)",
       "label_name" -> "sm_label",
       "batch_size" -> "50",
       "shuffle" -> "1",
       "flat" -> "0",
       "silent" -> "0",
       "seed" -> "10"))
   
     val valDataIter = IO.MNISTIter(Map(
       "image" -> "/Users/dyt/work/mxnet/t10k-images-idx3-ubyte",
       "label" -> "/Users/dyt/work/mxnet/t10k-labels-idx1-ubyte",
       "data_shape" -> "(1, 28, 28)",
       "label_name" -> "sm_label",
       "batch_size" -> "50",
       "shuffle" -> "1",
       "flat" -> "0", "silent" -> "0"))
   
     // setup model and fit the training data
     val model = FeedForward.newBuilder(mlp)
       .setContext(Context.cpu())
       .setNumEpoch(10)
       .setOptimizer(new SGD(learningRate = 0.1f, momentum = 0.9f, wd = 0.0001f))
       .setTrainData(trainDataIter)
       .setEvalData(valDataIter)
       .build()

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services