Rendered image as a generator

Edit:
I plodded through my python ignorance and fixed my code so that the model compiles.
I’ve updated my gist incase anyone else is interested how to get a rendered image into Theano.

I’m trying to train a CNN with image data that’s been drawn in python using PIL.
I feel that I am very close but I’m missing something. I’m pretty new to python so it’s likely that I don’t understand how NP arrays or generators work or something like that.

Please if you will have a look at this gist and give me a hit.
Thank you.
Brian

Example Notebook