Skip to content

Commit

Permalink
Merge pull request thtrieu#581 from off99555/hotfix
Browse files Browse the repository at this point in the history
Show error message when an image is corrupted
  • Loading branch information
abagshaw authored Feb 26, 2018
2 parents 17d56e4 + d79d08b commit 5fe906b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion darkflow/net/yolo/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ def shuffle(self):

for j in range(b*batch, b*batch+batch):
train_instance = data[shuffle_idx[j]]
inp, new_feed = self._batch(train_instance)
try:
inp, new_feed = self._batch(train_instance)
except ZeroDivisionError:
print("This image's width or height are zeros: ", train_instance[0])
print('train_instance:', train_instance)
print('Please remove or fix it then try again.')
raise

if inp is None: continue
x_batch += [np.expand_dims(inp, 0)]
Expand Down

0 comments on commit 5fe906b

Please sign in to comment.