Keras Version 2.2.2 AttributeError: 'ImageDataGenerator' object has no attribute 'flow_from_dataframe'

1,705 views
Skip to first unread message

Sudheer Kumar

unread,
Oct 9, 2018, 1:39:23 AM10/9/18
to Keras-users
Which version of Keras is planning to include method "flow_from_dataframe" for ImageDataGenerator? The Keras version 2.2.2 doesn't support it.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-9-723113058bd1> in <module>()
      2 datagen = ImageDataGenerator(rescale = 1./255., validation_split = 0.20)
      3 
----> 4 train_generator = datagen.flow_from_dataframe(dataframe = train_df,
      5                                                 directory = "../input/train/",
      6                                                 x_col = "Id",

AttributeError: 'ImageDataGenerator' object has no attribute 'flow_from_dataframe'

Matias Valdenegro

unread,
Oct 9, 2018, 2:10:05 AM10/9/18
to keras...@googlegroups.com

Keras 2.2.4 has this, released a few days ago.

asbhar...@gmail.com

unread,
Jan 22, 2019, 3:48:44 AM1/22/19
to Keras-users
Getting same error though i am using keras 2.2.4

Matias Valdenegro

unread,
Jan 22, 2019, 4:40:44 AM1/22/19
to keras...@googlegroups.com

>>> import keras
Using TensorFlow backend.
>>> keras.__version__
'2.2.4'
>>> gen = keras.preprocessing.image.ImageDataGenerator()
>>> gen.flow_from_dataframe
<bound method ImageDataGenerator.flow_from_dataframe of <keras.preprocessing.image.ImageDataGenerator object at 0x7faf7c8aa198>>

Make sure that you have keras 2.2.4 installed and you are actually using it (and not an older version).

Message has been deleted

lolo....@gmail.com

unread,
Apr 8, 2019, 3:49:57 PM4/8/19
to Keras-users
Uninstall Keras and install back using pip.
Good enough for me

maniks...@gmail.com

unread,
May 19, 2019, 3:55:22 PM5/19/19
to Keras-users

#Import from keras_preprocessing not from keras.preprocessing

Reply all
Reply to author
Forward
0 new messages