You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ar...@apache.org on 2021/03/23 16:47:18 UTC

[tvm] 01/02: fix path

This is an automated email from the ASF dual-hosted git repository.

areusch pushed a commit to branch ci-docker-staging
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 87be5dde40efe6743290ec9b26a7b2f2b7333eff
Author: Andrew Reusch <ar...@octoml.ai>
AuthorDate: Tue Mar 23 09:45:35 2021 -0700

    fix path
---
 tests/micro/zephyr/test_zephyr.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/micro/zephyr/test_zephyr.py b/tests/micro/zephyr/test_zephyr.py
index 09eb97e..c4626d3 100644
--- a/tests/micro/zephyr/test_zephyr.py
+++ b/tests/micro/zephyr/test_zephyr.py
@@ -214,16 +214,17 @@ def test_onnx(platform, west_cmd):
     model, zephyr_board = PLATFORMS[platform]
 
     # Load test images.
-    digit_2 = Image.open("testdata/digit-2.jpg").resize((28, 28))
+    this_dir = os.path.dirname(__file__)
+    digit_2 = Image.open(f"{this_dir}/testdata/digit-2.jpg").resize((28, 28))
     digit_2 = np.asarray(digit_2).astype("float32")
     digit_2 = np.expand_dims(digit_2, axis=0)
 
-    digit_9 = Image.open("testdata/digit-9.jpg").resize((28, 28))
+    digit_9 = Image.open(f"{this_dir}/testdata/digit-9.jpg").resize((28, 28))
     digit_9 = np.asarray(digit_9).astype("float32")
     digit_9 = np.expand_dims(digit_9, axis=0)
 
     # Load ONNX model and convert to Relay.
-    onnx_model = onnx.load("testdata/mnist-8.onnx")
+    onnx_model = onnx.load(f"{this_dir}/testdata/mnist-8.onnx")
     shape = (1, 1, 28, 28)
     relay_mod, params = relay.frontend.from_onnx(onnx_model, shape=shape, freeze_params=True)
     relay_mod = relay.transform.DynamicToStatic()(relay_mod)