mediumStudy question · answer published in Deep Learning interview questions, so no pointspytorchdeep-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
- Parameters in nn.Linear(10, 5)Machine Learning Engineer
- Why sigmoid slows deep trainingMachine Learning Engineer
- Range of tanhMachine Learning Engineer
- Cross-entropy loss by handMachine Learning Engineer
- Telling autograd to track a tensorMachine Learning Engineer
- Why wrap inference in no_gradMachine Learning Engineer
- Logging loss without leaking memoryMachine Learning Engineer