-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
scala-package/demo/demo.sh
Outdated
#!/bin/bash | ||
CURR_DIR=$(cd $(dirname $0); pwd) | ||
CLASSPATH=$CLASSPATH:$CURR_DIR/target/*:$CLASSPATH:$CURR_DIR/target/classes/lib/* | ||
java -Xmx8G -cp $CLASSPATH sample.HelloWorld |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPU/GPU flag like we did for examples?
object HelloWorld { | ||
def main(args: Array[String]): Unit = { | ||
println("hello World") | ||
val arr = NDArray.ones(2, 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass context based on CPU/GPU flag like examples?
scala-package/demo/demo.sh
Outdated
@@ -0,0 +1,4 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename folder from demo to maven-demo?
Also please test on linux |
scala-package/demo/pom.xml
Outdated
<properties> | ||
<mxnet.profile>osx-x86_64-cpu</mxnet.profile> | ||
<mxnet.version>1.2.0</mxnet.version> | ||
<scala.version>2.12.5</scala.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 2.12.5 ? we support 2.11.8
scala-package/mxnet-demo/Makefile
Outdated
endif | ||
endif | ||
|
||
ifeq ($(USE_CUDA), 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Linux then if CUDA
For makefile https://stackoverflow.com/questions/2741708/makefile-contains-string
bash bin/demo.sh | ||
``` | ||
It will load the library automatically and run the example | ||
### Image Classification using Inference API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are just copying the entire ImageClassification Example, we don't need to maintain it in two different places. I think it is redundant, lets remove this and just keep the HelloWorld
I was thinking of a more self contained code which downloads and runs the model on a fixed image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your thinking now come true :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, you rock 👍
# under the License. | ||
|
||
SCALA_VERSION_PROFILE := 2.11 | ||
SCALA_VERSION := 2.11.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just use one SCALA_VERSION
It should work with Scala 2.11.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maven cannot find a scala-library
if you just fill in 2.11
.
scala-package/mxnet-demo/README.md
Outdated
``` | ||
It will load the library automatically and run the example | ||
### Image Classification using Inference API | ||
We also provide an example to do image classification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also provide an example to do image classification, which downloads a ImageNet trained resnet18
model and runs inference on a cute puppy to return the classification result as
result
add what the customer should expect
You can review the complete example here
*/ | ||
object ImageClassificationExample { | ||
|
||
def downloadImage() : String = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you create one downloadUrl method instead of separate ?, we can move this to a TestUtils method and add hash check etc., later
downloadUrl(downloadFrom, downloadTo)
* Maven demo project
Description
A simple demo folder contains all you need to start a Scala project with maven
@nswamy @yzhliu @andrewfayres
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.