From 60e7debcc241510f8ed621f737d0a22241fa8ec6 Mon Sep 17 00:00:00 2001 From: Marya Date: Fri, 29 Sep 2023 16:57:09 +0100 Subject: [PATCH] update --- .../technical_blogs/tartan_blog/build_and_run_networks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/technical_blogs/tartan_blog/build_and_run_networks.py b/examples/technical_blogs/tartan_blog/build_and_run_networks.py index 1dce9195c..46929c5e1 100644 --- a/examples/technical_blogs/tartan_blog/build_and_run_networks.py +++ b/examples/technical_blogs/tartan_blog/build_and_run_networks.py @@ -47,6 +47,7 @@ def run_cmake_and_ninja(cmake_command, build_dir): subprocess.run(["ninja", "-C", build_dir], check=True) except subprocess.CalledProcessError as e: print(f"Error executing command: {e}", file=sys.stderr) + sys.exit(1) # Build portBLAS def build_portBLAS(): @@ -108,8 +109,10 @@ def download_and_convert_model(dir, file_url, destination_file, h5_to_bin_script os.chdir("..") # Move up one level to the parent directory except requests.exceptions.RequestException as e: print(f"Error downloading file: {e}", file=sys.stderr) + sys.exit(1) except subprocess.CalledProcessError as e: print(f"Error running h5toBin.py: {e}", file=sys.stderr) + sys.exit(1) def prepare_image(img_script_path, input_image): @@ -118,6 +121,7 @@ def prepare_image(img_script_path, input_image): print(f"Image prepared successfully.") except subprocess.CalledProcessError as e: print(f"Error executing the script: {e}", file=sys.stderr) + sys.exit(1) # Test on images def test_image(model_script, data_dir, output_file): @@ -131,6 +135,7 @@ def test_image(model_script, data_dir, output_file): print(f"Image tested successfully with {os.path.basename(model_script)}.") except subprocess.CalledProcessError as e: print(f"Error executing the command: {e}", file=sys.stderr) + sys.exit(1) def main():