From 28a253cd175ffc672215863dc9c6f4932827db74 Mon Sep 17 00:00:00 2001 From: Yina Chen <33650826+cyita@users.noreply.github.com> Date: Fri, 27 Nov 2020 15:06:34 +0800 Subject: [PATCH] fix tar (#3137) --- .../test/bigdl/orca/learn/spark/test_estimator_openvino.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/orca/test/bigdl/orca/learn/spark/test_estimator_openvino.py b/python/orca/test/bigdl/orca/learn/spark/test_estimator_openvino.py index ffe1718cbd5..0ca24143906 100644 --- a/python/orca/test/bigdl/orca/learn/spark/test_estimator_openvino.py +++ b/python/orca/test/bigdl/orca/learn/spark/test_estimator_openvino.py @@ -16,6 +16,7 @@ import os import tempfile import subprocess +import tarfile from unittest import TestCase import numpy as np @@ -43,8 +44,9 @@ def test_openvino(self): model_url = data_url + "/analytics-zoo-data/openvino2020_resnet50.tar" model_path = maybe_download("openvino2020_resnet50.tar", local_path, model_url) - cmd = "tar -xvf " + model_path + " -C " + local_path - subprocess.Popen(cmd.split()) + tar = tarfile.open(model_path) + tar.extractall(path=local_path) + tar.close() model_path = os.path.join(local_path, "openvino2020_resnet50/resnet_v1_50.xml") est = Estimator.from_openvino(model_path=model_path)