SpinTheMic
Pro

Interview practice question

Tracking down NaN losses with PyTorch tools

Machine Learning · ML Frameworks · Intermediate

Your neural network's loss suddenly becomes NaN during training. How do you debug it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Learning rate too high; exploding gradients.
  • Data issues: NaN/inf in inputs, bad labels.
  • Numerical instability (log of zero, division).
  • Mixed precision overflow (FP16).
  • Fixes: gradient clipping, lower LR, check data, anomaly detection.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics