Skip to content

Commit

Permalink
Raising an exception when no data is found.
Browse files Browse the repository at this point in the history
  • Loading branch information
costapt committed Feb 8, 2017
1 parent 6730a2d commit b4acf26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def __init__(self, directory, a_dir_name='A', b_dir_name='B', load_to_memory=Fal
random.shuffle(self.filenames)
self.filenames = self.filenames[:N]
self.N = len(self.filenames)
if self.N == 0:
raise Exception("""Did not find any pair in the dataset. Please check that """
"""the names and extensions of the pairs are exactly the same. """
"""Searched inside folders: {0} and {1}""".format(self.a_dir, self.b_dir))

self.dim_ordering = dim_ordering
if self.dim_ordering not in ('th', 'default', 'tf'):
Expand Down

0 comments on commit b4acf26

Please sign in to comment.