Thank you @ajbrock for the reply. My idea behind using a class variable( out_saved)  that is shared between bottleneck layers was to only save the output of the last frozen layer(to make it as memory efficient as possible)
I am trying to directly compare your iteration wise training to my epoch wise training with pre-computation of output. As soon as we freeze the layer, the validation error is escalating… I will store the output in a file and analyze it if i am grabbing the correct part of the list and update you.
I just ran the code again and now it does not throw such error which is surprising for me.
Yes i have the test variable set to true such that while calculating validation error, it uses the original network.