Closed GetDarren closed 5 years ago
What version of Keras are you using? As suggested in #76, try reinstalling Keras and specify version 2.1.2 by running pip install keras==2.1.2
What version of Keras are you using? As suggested in #76, try reinstalling Keras and specify version 2.1.2 by running
pip install keras==2.1.2
Thanks for your help, I was using keras==2.2.4. After I change the version of keras 2.1.2, it works well.
Why does 2.1.2 work but not the latest version of Keras?
The new version of keras.preprocessing.image.ImageDataGenerator has a different order of params. It add a brightness_range between height_shift_range and shear_range
keras.preprocessing.image.ImageDataGenerator(featurewise_center=False,
samplewise_center=False,
featurewise_std_normalization=False,
samplewise_std_normalization=False,
zca_whitening=False,
zca_epsilon=1e-06,
rotation_range=0,
width_shift_range=0.0,
height_shift_range=0.0,
brightness_range=None,
shear_range=0.0,
zoom_range=0.0,
channel_shift_range=0.0,
fill_mode='nearest',
cval=0.0,
horizontal_flip=False,
vertical_flip=False,
rescale=None,
preprocessing_function=None,
data_format=None,
validation_split=0.0,
dtype=None)
So you can rewrite the DriveDataGenerator in Generator.py file like this to solve it:
super(DriveDataGenerator, self).__init__(
featurewise_center=featurewise_center,
samplewise_center=samplewise_center,
featurewise_std_normalization=featurewise_std_normalization,
samplewise_std_normalization=samplewise_std_normalization,
zca_whitening=zca_whitening,
zca_epsilon=zca_epsilon,
rotation_range=rotation_range,
width_shift_range=width_shift_range,
height_shift_range=height_shift_range,
shear_range=shear_range,
zoom_range=zoom_range,
channel_shift_range=channel_shift_range,
fill_mode=fill_mode,
cval=cval,
horizontal_flip=horizontal_flip,
vertical_flip=vertical_flip,
rescale=rescale,
preprocessing_function=preprocessing_function,
data_format=data_format)
The new version of keras.preprocessing.image.ImageDataGenerator has a different order of params. It add a brightness_range between height_shift_range and shear_range
keras.preprocessing.image.ImageDataGenerator(featurewise_center=False, samplewise_center=False, featurewise_std_normalization=False, samplewise_std_normalization=False, zca_whitening=False, zca_epsilon=1e-06, rotation_range=0, width_shift_range=0.0, height_shift_range=0.0, brightness_range=None, shear_range=0.0, zoom_range=0.0, channel_shift_range=0.0, fill_mode='nearest', cval=0.0, horizontal_flip=False, vertical_flip=False, rescale=None, preprocessing_function=None, data_format=None, validation_split=0.0, dtype=None)
So you can rewrite the DriveDataGenerator in Generator.py file like this to solve it:
super(DriveDataGenerator, self).__init__( featurewise_center=featurewise_center, samplewise_center=samplewise_center, featurewise_std_normalization=featurewise_std_normalization, samplewise_std_normalization=samplewise_std_normalization, zca_whitening=zca_whitening, zca_epsilon=zca_epsilon, rotation_range=rotation_range, width_shift_range=width_shift_range, height_shift_range=height_shift_range, shear_range=shear_range, zoom_range=zoom_range, channel_shift_range=channel_shift_range, fill_mode=fill_mode, cval=cval, horizontal_flip=horizontal_flip, vertical_flip=vertical_flip, rescale=rescale, preprocessing_function=preprocessing_function, data_format=data_format)
This is great, thank you!
This issue maybe silly, I'm new to this area, Sorry to have your time.
When I run into the TrainModel.ipynb
The error message as below:
It seems the data type of "intensity_range" is 'str', which should be a number. but I cannot find where the channel_shift_range been assigned as 'str' Please help me out.