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/10/22 21:47:33 UTC

[GitHub] gigasquid commented on a change in pull request #12881: Improve the Clojure Package README to Make it Easier to Get Started

gigasquid commented on a change in pull request #12881: Improve the Clojure Package README to Make it Easier to Get Started
URL: https://github.com/apache/incubator-mxnet/pull/12881#discussion_r227144386
 
 

 ##########
 File path: contrib/clojure-package/README.md
 ##########
 @@ -80,36 +86,33 @@ wget https://archive.archlinux.org/packages/c/cuda/cuda-9.0.176-4-x86_64.pkg.tar
 sudo pacman -U cuda-9.0.176-4-x86_64.pkg.tar.xz
 ```
 
-If you want to see the exact versions and flags that the jars were built with, look here:
-[Scala Release Process](https://cwiki.apache.org/confluence/display/MXNET/MXNet-Scala+Release+Process)
+At this point you should be able to run your own example like this [NDArray Tutorial](https://github.com/apache/incubator-mxnet/blob/master/contrib/clojure-package/examples/tutorial/src/tutorial/ndarray.clj)
 
+### Getting Started with MXNet project with the Prebuilt Scala Jars
 
-Check your installation with `lein test`. If that works alright then, you can try some code!
+This option is also fast. It doesn't require you to build the native C library or the Scala jars, it gets them from [Maven](https://search.maven.org/search?q=g:org.apache.mxnet) as well. 
 
-```clojure
+- `git clone --recursive https://github.com/apache/incubator-mxnet.git ~/mxnet`
+- `cd mxnet`
+- `git tag —list` (find the tag that corresponds the the version of the latest Scala jar)
+- `git checkout tags/<tag_name> -b <branch_name>`
+- `cd contrib/clojure`
+- edit `project.clj` to include your Scala jar from maven. It should match your system. Example `[org.apache.mxnet/mxnet-full_2.11-linux-x86_64-cpu "x.y.z”]`
+- run `lein test`. All the tests should run without an error
+- At this point you can do `lein install` to build and install the clojure jar locally. Now, you can run the examples by doing `cd examples/imclassification` and then `lein run`  or `lein run :cpu 2` (for 2 cpus) (for gpu `lein run :gpu`)
 
-(ns tutorial.ndarray
-  (:require [org.apache.clojure-mxnet.ndarray :as ndarray]
-            [org.apache.clojure-mxnet.context :as context]))
+You also might need dependencies installed based on your system. Please see the dependency section in above in _Getting Started with the Clojure Jars on Maven_
 
-;;Create NDArray
-(def a (ndarray/zeros [100 50])) ;;all zero arrray of dimension 100 x 50
-(def b (ndarray/ones [256 32 128 1])) ;; all one array of dimension
-(def c (ndarray/array [1 2 3 4 5 6] [2 3])) ;; array with contents of a shape 2 x 3
-
-;;; There are also ways to convert to a vec or get the shape as an object or vec
-(ndarray/->vec c) ;=> [1.0 2.0 3.0 4.0 5.0 6.0]
-```
-
-See the examples/tutorial section for more.
 
+### Getting Started with MXNet project with Building from Source
 
 Review comment:
   Good point - changed

----------------------------------------------------------------
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