diff --git a/prepare_data.py b/prepare_data.py index fc232e8..f37c1e2 100644 --- a/prepare_data.py +++ b/prepare_data.py @@ -35,7 +35,7 @@ def get_dataset(dataset_root_dir): # print("image_path: {}".format(all_image_path[:])) # print("image_label: {}".format(all_image_label[:])) # load the dataset and preprocess images - image_dataset = tf.data.Dataset.from_tensor_slices(all_image_path).map(load_and_preprocess_image) + image_dataset = tf.data.Dataset.from_tensor_slices(all_image_path).map(load_and_preprocess_image,num_parallel_calls=tf.data.experimental.AUTOTUNE) label_dataset = tf.data.Dataset.from_tensor_slices(all_image_label) dataset = tf.data.Dataset.zip((image_dataset, label_dataset)) image_count = len(all_image_path)