Precision-ill is undefined while training Pytorch Models

While training large models with PyTorch, sometimes the model does not update in certain epochs. All detections are incorrect, and the precision, recall, and F1-score are inconsistent. What should I do to resolve this issue during updates? This problem does not seem to occur with TensorFlow.