Hi,
I did check but I did not really had any useful update 
In particular, I have no idea how memcnn works and the error comes from there as removing it fixes the issue.
I guess you want to do something similar to what is explained in this post: Mysterious `trying to backward through the graph a second time' issue 5 to try and figure out where the problem comes from