I got a similar error as below
“Calculated padded input size per channel: (3 x 3). Kernel size: (5 x 5). Kernel size can’t greater than actual input size at /pytorch/aten/src/THNN/generic/SpatialConvolutionMM.c:48”
I was try to load pretrained inception model and test a image
‘’
net = models.inception_v3(pretrained=False)
net.fc = nn.Linear(2048, 2)
net_dict = torch.load(‘model_inception.pt’)
print net
net.load_state_dict(net_dict[‘state_dict’])
#checkpoint = torch.load(Path(‘model_resnet.pt’))
#model.load_state_dict(checkpoint)
trans = transforms.Compose([
transforms.RandomHorizontalFlip(),
transforms.Resize((229,229)),
transforms.ToTensor(),
#transforms.Normalize((0.5, 0.5, 0.5),(0.5, 0.5, 0.5))
])

#for file in glob(’.png’):
for file in glob.glob("/home/CN/.png"):
#print (file)
img_pil= Image.open(file)
input = trans(img_pil)
input = input.view(1, 3, 229,229)

output = net(input)

prediction = int(torch.max(output.data, 1)[1].numpy())
#print(prediction)

if (prediction == 0):
    print ('AD')
if (prediction == 1):
    print ('CN')
    
print((file,prediction))

    
    
    
prob = F.softmax(output, dim=1)
print prob

‘’