Skip to content

Commit

Permalink
Fix issues related to keras_preprocessing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Sep 28, 2018
1 parent 6a1702d commit dd9109d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
3 changes: 0 additions & 3 deletions keras/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@

import numpy as np
from numpy.testing import assert_allclose
import six

from .generic_utils import has_arg
from ..engine import Model, Input
from ..models import Sequential
from ..models import model_from_json
from .. import backend as K


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'pyyaml',
'h5py',
'keras_applications>=1.0.6',
'keras_preprocessing>=1.0.4'],
'keras_preprocessing>=1.0.5'],
extras_require={
'visualize': ['pydot>=1.2.4'],
'tests': ['pytest',
Expand Down
24 changes: 0 additions & 24 deletions tests/integration_tests/preprocessing/image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,30 +167,6 @@ def test_image_data_generator(self, tmpdir):
x2, y2 = seq[0]
assert list(y) != list(y2)

def test_image_data_generator_with_validation_split(self):
for test_images in self.all_test_images:
img_list = []
for im in test_images:
img_list.append(image.img_to_array(im)[None, ...])

images = np.vstack(img_list)
generator = image.ImageDataGenerator(validation_split=0.5)
seq = generator.flow(images, np.arange(images.shape[0]),
shuffle=False, batch_size=3,
subset='validation')
x, y = seq[0]
assert list(y) == [0, 1, 2]
seq = generator.flow(images, np.arange(images.shape[0]),
shuffle=False, batch_size=3,
subset='training')
x2, y2 = seq[0]
assert list(y2) == [4, 5, 6]

with pytest.raises(ValueError):
generator.flow(images, np.arange(images.shape[0]),
shuffle=False, batch_size=3,
subset='foo')

def test_image_data_generator_with_split_value_error(self):
with pytest.raises(ValueError):
generator = image.ImageDataGenerator(validation_split=5)
Expand Down

0 comments on commit dd9109d

Please sign in to comment.