Depending on your use case, model, etc. the training might be sensitive to e.g. the initialization of the model as well as other hyperparameters.
You could try to use other init methods from torch.nn.init or play around with other hyperparameters such as the learning rate (maybe it’s too high and lets the model diverge in a lot of cases).