Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryaSharf committed Sep 29, 2023
1 parent 2a29ba5 commit 409c3af
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def download_and_convert_model(dir, file_url, destination_file, h5_to_bin_script
else:
os.mkdir(path)
print(f"Directory '{path}' created successfully.")
os.chdir(path)

# Check if the file already exists
if os.path.exists(destination_file):
Expand All @@ -111,7 +110,6 @@ def download_and_convert_model(dir, file_url, destination_file, h5_to_bin_script
print(f"Error downloading file: {e}", file=sys.stderr)
except subprocess.CalledProcessError as e:
print(f"Error running h5toBin.py: {e}", file=sys.stderr)
os.chdir("..")


def prepare_image(img_script_path, input_image):
Expand Down Expand Up @@ -150,14 +148,14 @@ def main():

# VGG16
vgg_url = "https://storage.googleapis.com/tensorflow/keras-applications/vgg16/vgg16_weights_tf_dim_ordering_tf_kernels.h5"
vgg_dest_file = "vgg16_weights_tf_dim_ordering_tf_kernels.h5"
vgg_dest_file = os.path.join(vgg_dir, "vgg16_weights_tf_dim_ordering_tf_kernels.h5")
vgg_h5_to_bin_script = os.path.join(args.SYCL_DNN_source, "samples", "networks", "vgg", "h5toBin.py")

download_and_convert_model(vgg_dir, vgg_url, vgg_dest_file, vgg_h5_to_bin_script)

# Resnet50
resnet_url = "https://storage.googleapis.com/tensorflow/keras-applications/resnet/resnet50_weights_tf_dim_ordering_tf_kernels.h5"
resnet_dest_file = "resnet50_weights_tf_dim_ordering_tf_kernels.h5"
resnet_dest_file = os.path.join(resnet_dir, "resnet50_weights_tf_dim_ordering_tf_kernels.h5")
resnet_h5_to_bin_script = os.path.join(args.SYCL_DNN_source, "samples", "networks", "resnet50", "h5toBin.py")

download_and_convert_model(resnet_dir, resnet_url, resnet_dest_file, resnet_h5_to_bin_script)
Expand Down

0 comments on commit 409c3af

Please sign in to comment.