Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit 40c0039

Browse files
corrected size checking in image loading
1 parent adb7bcf commit 40c0039

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

keras_preprocessing/image/iterator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ def _get_batches_of_transformed_samples(self, index_array):
242242
# NOTE: we could potentially have keyword arguments for the
243243
# resizing function
244244
x = self.resizing_function(x)
245-
if x.shape[:-1] != self.target_size:
245+
if x.shape != self.image_shape:
246246
raise ValueError(
247-
'The loaded image size %s (at %s) does not correspond to'
248-
'the target size %s' %
249-
(str(x.shape[:-1]), filepaths[j], str(self.target_size)))
247+
'The loaded image shape %s (at %s) does not correspond to'
248+
'the specified image shape %s' %
249+
(str(x.shape), filepaths[j], str(self.image_shape)))
250250
# Pillow images should be closed after `load_img`,
251251
# but not PIL images.
252252
if hasattr(img, 'close'):

0 commit comments

Comments
 (0)