From 8c877c7a6f7b47484dd048624fdb0e2215251cde Mon Sep 17 00:00:00 2001 From: Martin Dreier Date: Thu, 2 Apr 2020 15:01:13 +0200 Subject: [PATCH] Strip trailing slashes from paths Some file systems may add trailing slashing when listing folder contents --- deeplearning2020/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deeplearning2020/datasets.py b/deeplearning2020/datasets.py index 3acb0ec..a3f7958 100644 --- a/deeplearning2020/datasets.py +++ b/deeplearning2020/datasets.py @@ -62,7 +62,7 @@ def __init__(self, dataset: str, file_path: str = None) -> None: print(f"Loaded {self.image_count} images") self.raw_class_names = [ - item for item in tf.io.gfile.listdir(data_dir) if item != "LICENSE.txt" + item.strip("/") for item in tf.io.gfile.listdir(data_dir) if item != "LICENSE.txt" ] self.raw_class_names.sort()