BatchNorm won’t work with a single sample. If the training is good and you would like to pass a single image into the net, you could set the model to eval with model.eval(). Otherwise if you would like to train the model, you should remove the BatchNorm layers and use InstanceNorm for example.