Error with predict() #7068
-
Hi @awaelchli and thanks for your time, as you asked in pull requests, i am pinging you here For other who see this, it's a discussion about Trainer.predict method where it is running BatchNorm Layers, code is below: https://colab.research.google.com/drive/1jujP4F_prSmbRz-F_wGfWPTKGOmY5DPE?usp=sharing What is the problem with my approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Predict takes a dataloader, not a tensor. It still "works" because the trainer just iterates through the batch dimension, but then you get an error later because the input lost the batch dimension, and batch norm doesn't work with batch size 1. |
Beta Was this translation helpful? Give feedback.
Predict takes a dataloader, not a tensor. It still "works" because the trainer just iterates through the batch dimension, but then you get an error later because the input lost the batch dimension, and batch norm doesn't work with batch size 1.