Skip to content

Commit

Permalink
Strip trailing slashes from paths
Browse files Browse the repository at this point in the history
Some file systems may add trailing slashing when listing folder contents
  • Loading branch information
Martin Dreier committed Apr 3, 2020
1 parent 2c17d7b commit 8c877c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deeplearning2020/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 8c877c7

Please sign in to comment.