Thanks @ptrblck. I’m finetuning a pretrained densenet201 from PyTorch. The input image is RGB, image dimension is 600x450. I’m freezing the first layers and updating the weights of the other successive layers. When I replace the default pretrained densenet201 classifier with this class, I get the dimension error.