Skip to content

Commit baf093d

Browse files
committed
iter
1 parent d6ca775 commit baf093d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

imblearn/keras/_generator.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ def import_from_keras():
1717
try:
1818
import keras # noqa
1919

20-
try:
20+
if hasattr(keras.utils, "Sequence"):
2121
# Older versions of Keras provide the Sequence class directly in utils
22-
from keras.utils import Sequence
23-
except ImportError:
24-
from keras.utils.data_utils import Sequence
25-
26-
return (Sequence,), True
22+
return (keras.utils.Sequence,), True
23+
return (keras.utils.data_utils.Sequence,), True
2724
except ImportError:
2825
return tuple(), False
2926

0 commit comments

Comments
 (0)