While doing load images from valdation folder there is memory error

Error is: Unable to allocate 11.2 GiB for an array with shape (10000, 224, 224, 3) and data type float64.

Colab link: https://colab.research.google.com/drive/1CNymUlUjS5bJnRmubudE_sO5-MSoU0qg?usp=sharing

hey @lgoyal50_be19 ,
You are using very large batch_size which is not able to get allocated in the memory.
So , just lower that batch_size and then check it will work.

I hope this helps.

How to reduce batch size?

for validation data, you are just simply returning it as an array of such 1000 images.
Instead use a generator to do this task , this will generate your data is batches of small number of images.
Hence, you will only utilize a small proportion of memory at a time and hence, it will work.