medium10 pts · first answer countspytorchdeep-learning
Different results every inference run
A PyTorch model gives slightly different predictions each time you run it on the same input, and validation accuracy is lower than expected. The model has dropout and batch norm layers. What did you most likely forget?
model.load_state_dict(torch.load("model.pt"))
with torch.no_grad():
preds = model(x_val)Discussion 0
Join free to post in the discussion.
Related questions
- Dropout after eval()Machine Learning Engineer
- Early layers stop learningMachine Learning Engineer
- Gradient of a sum of squaresMachine Learning Engineer
- Training loop without zero_gradMachine Learning Engineer
- Softmax before CrossEntropyLossMachine Learning Engineer
- Shape after a batched matmulMachine Learning Engineer
- Initialisation for a deep ReLU networkMachine Learning Engineer
- Why fp16 needs loss scaling but bf16 usually does notMachine Learning Engineer