It looks like something is strange with your input. Standard torchvision models expect 3-channel color images in NCHW format (usually something like [64, 3, 224, 224] for ImageNet]). An odd-numbered batch size with 5x5 spatial resolution [6451, 1, 5, 5] is odd here.