Problem in implementing CNN
The main problem in your code is that you are passing the whole data at once ,instead of that you should use a batch size of 500 or some other value .There is a parameter of batch size in model.fit()
as well. And you should also reduce the number of epochs.