Solved by ptrblck in post #2 
              
              
                Do you see the NaN from the first iteration or after a while? 
In the latter case, could you check the loss values, as they might just blow up? 
If that’s the case, check the gradients (or their norm). 
Is the input to your model normalized? If not, try normalizing it, as large input values might al…