Skip to content

Commit

Permalink
fix(classifier): duplicated ImageDataGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Apr 1, 2024
1 parent ac052c9 commit de6bcae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stagesepx/classifier/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
import tensorflow
except ImportError:
raise ImportError("KerasClassifier requires tensorflow. install it first.")
from keras.preprocessing.image import ImageDataGenerator

try:
from keras.preprocessing.image import ImageDataGenerator
except ImportError:
# https://stackoverflow.com/questions/78145837/importerror-cannot-import-name-imagedatagenerator-from-keras-preprocessing-i
from keras.src.legacy.preprocessing.image import ImageDataGenerator

# https://github.com/tensorflow/models/issues/6177
from tensorflow.keras.models import Sequential
Expand Down

0 comments on commit de6bcae

Please sign in to comment.