I can try this. Currently installed version is the official distributed version which I downloaded in August 2017.
This I cannot do. I don’t think this is specific to code. Indeed it seems to be caused by conv2 (or other conv operations), but the same code usually runs without problem. I did test with different codes.

But I do stop programs using keyboard interrupt (Ctrl+C). Could this mess up with the cuDNN status? That sometimes does not clear up the GPU memory, too.