Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fixed based on the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lanking520 committed Feb 27, 2019
1 parent 86a4722 commit 2379327
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions scala-package/mxnet-demo/java-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
<!--- under the License. -->

# MXNet Java Sample Project
This is an project created to use Maven-published Scala/Java package with two Java examples.
This is a project demonstrating how to use the Maven published Scala/Java MXNet package.
The examples provided include:
* NDArray creation
* NDArray operation
* Object Detection using the Inference API
* Image Classification using the Predictor API

## Setup
You are required to use Maven to build the package with the following commands:
You are required to use Maven to build the package with the following commands under `java-demo`:
```
mvn package
```
Expand All @@ -43,15 +49,15 @@ The `SCALA_PKG_PROFILE` should be chosen from `osx-x86_64-cpu`, `linux-x86_64-cp

## Run
### NDArrayCreation
The Scala file is being executed using Java. You can execute the helloWorld example as follows:
The Scala file is being executed using Java. You can execute the `NDArrayCreation` example as follows:
```Bash
bash bin/java_sample.sh
```
You can also run the following command manually:
```Bash
java -cp $CLASSPATH sample.NDArrayCreation
```
However, you have to define the Classpath before you run the demo code. More information can be found in the `java_sample.sh`.
However, you have to define the Classpath before you run the demo code. More information can be found in `bin/java_sample.sh`.
The `CLASSPATH` should point to the jar file you have downloaded.

It will load the library automatically and run the example
Expand Down
2 changes: 1 addition & 1 deletion scala-package/mxnet-demo/java-demo/bin/java_sample.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#!/bin/bash
CURR_DIR=$(cd $(dirname $0)/../; pwd)
CLASSPATH=$CLASSPATH:$CURR_DIR/target/*:$CLASSPATH:$CURR_DIR/target/dependency/*
java -Xmx8G -cp $CLASSPATH mxnet.NDArrayCreation
java -Xmx8G -cp $CLASSPATH mxnet.NDArrayCreation
2 changes: 1 addition & 1 deletion scala-package/mxnet-demo/java-demo/bin/run_od.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#!/bin/bash
CURR_DIR=$(cd $(dirname $0)/../; pwd)
CLASSPATH=$CLASSPATH:$CURR_DIR/target/*:$CLASSPATH:$CURR_DIR/target/dependency/*
java -Xmx8G -cp $CLASSPATH mxnet.ObjectDetection
java -Xmx8G -cp $CLASSPATH mxnet.ObjectDetection

0 comments on commit 2379327

Please sign in to comment.