Most likely you’ll see this error in a batchnorm layer, which cannot calculate the running batch statistics from a single value in each channel.
It’s similar to the Inception3() from torchvision, which also expects at least two samples in a batch during training.
Would it be possible to provide more than a single sample or are you running out of memory?