Solved by fadetoblack in post #11 
              
              
                Firstly, a good idea might be to debug why you’re getting nans in your landmarks tensor. 
Secondly, there might be an issue with the way normalizing is being done. Since landmarks are (x,y) pairs on an image, it might not be suitable to divide by the max landmark value to normalize. 
As I mentioned …