I too faced the same problem, the way I went debugging  it was:
You can check your codes output after each iteration,
if the output is same then there is no learning happening.
maybe some of the parameters of your model which were not supposed to be detached might have got detached.