Hello,
I trained a network which should recognize characters from the EMNIST dataset. Which works fine.
But now I have the problem that I want to use my own images. Does anybody know a useful way to do that?
I tried this code but the results are wrong:
transform = transforms.Compose([
    transforms.Resize((28, 28)),
    transforms.ToTensor()])

model.eval()
img = Image.open(picture_name)
img_tensor = transform(img)
img_tensor_array = img_tensor.unsqueeze(0)
#pil_image = transforms.ToPILImage(mode='L')(img_tensor)
with torch.no_grad():
    data = Variable(img_tensor_array.cuda())
#plt.imshow(pil_image)
#plt.show()
out = model(data)
print(out.data.max(1, keepdim=True)[1])      # print the result

Thanks for all useful answers!!!