This is an automated email from the ASF dual-hosted git repository.
mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git
The following commit(s) were added to refs/heads/master by this push:
new 871a946 Use local onnx model (#549)
871a946 is described below
commit 871a94640f3ac5e49981af0ee94982a4e5d37e10
Author: Hongbo <[email protected]>
AuthorDate: Thu Aug 19 13:48:30 2021 -0400
Use local onnx model (#549)
---
.../python/wasm_tvm_mnist_payload/build_lib.py | 24 ++++++++++++---------
.../python/wasm_tvm_mnist_payload/mnist-8.onnx | Bin 0 -> 26454 bytes
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/examples/python/wasm_tvm_mnist_payload/build_lib.py
b/examples/python/wasm_tvm_mnist_payload/build_lib.py
index fbd3a66..6e4beb9 100755
--- a/examples/python/wasm_tvm_mnist_payload/build_lib.py
+++ b/examples/python/wasm_tvm_mnist_payload/build_lib.py
@@ -31,13 +31,13 @@ from PIL import Image
import numpy as np
import tvm.relay as relay
+# This example uses mnist-8 model from:
# https://github.com/onnx/models/tree/master/vision/classification/mnist
-# This example uses mnist-8 model
-model_url = "".join([
- "https://github.com/onnx/models/raw/master",
- "/vision/classification/mnist/model/mnist-8.onnx"
-])
+# model_url = "".join([
+# "https://github.com/onnx/models/raw/master",
+# "/vision/classification/mnist/model/mnist-8.onnx"
+# ])
def build_graph_lib(opt_level):
@@ -47,11 +47,15 @@ def build_graph_lib(opt_level):
os.makedirs(out_dir)
# Follow the tutorial to download and compile the model
- model_path = download_testdata(model_url,
- "mnist-8.onnx",
- module="onnx",
- overwrite=True)
- # print(model_path)
+ # model_path = download_testdata(model_url,
+ # "mnist-8.onnx",
+ # module="onnx",
+ # overwrite=True)
+
+ # use the local model in case the LFS server is down
+ # comment this line if a model from other source is needed
+ model_path = "./mnist-8.onnx"
+
onnx_model = onnx.load(model_path)
img_path = "./data/img_10.jpg"
diff --git a/examples/python/wasm_tvm_mnist_payload/mnist-8.onnx
b/examples/python/wasm_tvm_mnist_payload/mnist-8.onnx
new file mode 100644
index 0000000..fc1a3f7
Binary files /dev/null and
b/examples/python/wasm_tvm_mnist_payload/mnist-8.onnx differ
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]