Resource Exhausted Error in Dogs and Cats redux code implementation

I am trying to follow the solution for Kaggle Dogs and Cats challenge.
As given in the dogscats redux ipython notebook, I was following along, skipping the steps to get the data in the correct directory structure as I already have the data like that.
When I try to run the code I get a resource exhaust error when trying to allocate 748 MB of memory. I have an NVIDIA 4 GB graphics card on my laptop and the code works fine on CPU without graphics card.

I am using keras 2 and python 3. The utils.py and vgg16.py that I am using are from another user who generously shared the modified files (link).
I am running the code in a jupyter notebook using anaconda virtual environment on a windows 10 machine.

Please tell if need anymore information on this issue.