Solved by Parskatt in post #6 
              
              
                Looking at this a bit more your code seems problematic. You can’t just detach and then reattach tensors to the computational graph, sorry that I didn’t really read carefully before. Can you explain why you don’t just use (gt_coord-pred_coord)**2 ? 
Is it because you somehow don’t care about the orde…