Skip to content
Advertisement

Unable to load numpy array into `model.fit`

i’m new to deep learning with Keras, so please inform me if i need to include more data in this post! So currently i have done some image augmentation to my training set for the MNIST dataset i had. So, i referred to this post here and i tried to save my augmented image models into the array. But when i try to reload the images and put into my mode.fit(), it throws me this error:

JavaScript

How do i solve this?

Here is my current codes:

JavaScript
JavaScript
JavaScript
JavaScript
JavaScript

Advertisement

Answer

If you use zca_whitening=True then it is necessary to fit the generator to the data before you train so use

JavaScript

I ran your code up to

JavaScript

I printed the shape of the augmented data which looks correct with shape of (60000, 28, 28, 1) I did not proceed any further so was not able to find the problem but at least the data going into model.fit looks correct. I had trouble with the code for your model.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement