From 9bc903bf1b44a5212d308d467d96b00cd2ae522c Mon Sep 17 00:00:00 2001 From: Sachin Prasad Date: Fri, 2 Jun 2023 15:47:37 -0700 Subject: [PATCH] Ignore hidden folders for image_dataset_from_directory --- keras/utils/dataset_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras/utils/dataset_utils.py b/keras/utils/dataset_utils.py index 6dee21b3972..42297f70e29 100644 --- a/keras/utils/dataset_utils.py +++ b/keras/utils/dataset_utils.py @@ -540,7 +540,7 @@ def index_directory( else: subdirs = [] for subdir in sorted(tf.io.gfile.listdir(directory)): - if tf.io.gfile.isdir(tf.io.gfile.join(directory, subdir)) and not subdir.startswith("."): + if tf.io.gfile.isdir(tf.io.gfile.join(directory, subdir))and subdir[0]!='.': if subdir.endswith("/"): subdir = subdir[:-1] subdirs.append(subdir)