Hello, im new to AI and im trying to make net for certain images to determinate cats,dogs etc but I have this error and im kinda confused. I made my own MNIST dataset.
class Neurons:
    def __init__(self):
        dataset = MNIST('C:\\Users\\kratu\\PycharmProjects\\Projekt_AI-Automatyczny_saper\\Engine', gz=True, return_type='numpy')
        images, labels = dataset.load_training()
        test_images, test_labels = dataset.load_testing()
        images = images / 255
        test_images = test_images / 255

        self.train_images = [torch.tensor(image, dtype=torch.float32) for image in images]
        self.train_labels = [torch.tensor(label, dtype=torch.long) for label in labels]
        test_images = [torch.tensor(image, dtype=torch.float32) for image in test_images]
        test_labels = [torch.tensor(label, dtype=torch.long) for label in test_labels]

     input_dim = 28 * 28
        output_dim = 10
        hidden_dim = 10

        self.model = nn.Sequential(
            nn.Linear(input_dim, hidden_dim),
            nn.ReLU(),
            nn.Linear(hidden_dim, output_dim),
            nn.LogSoftmax()
        )
        self.model.eval()
        torch.save(self.train(self.model, 100), 'model.pth')
        imsize = 28
        loader = transforms.Compose([transforms.Resize((imsize, imsize)), transforms.ToTensor()])
        image = Image.open("$FILENAME")
        image = image.convert("1")
        image = loader(image).float()
        image = Variable(image, requires_grad=True)
        predicted = self.model(image)
        print(predicted)

    def train(self,model, n_iter):
        criterion = nn.NLLLoss()
        optimizer = optim.SGD(model.parameters(), lr=0.001)

        for epoch in range(n_iter):
            for image, label in zip(self.train_images, self.train_labels):
                optimizer.zero_grad()

                output = model(image)
                loss = criterion(output.unsqueeze(0), label.unsqueeze(0))
                loss.backward()
                optimizer.step()

            print(f'epoch: {epoch:03}')
        return model



I just want to predict the solution for single image.
RuntimeError: mat1 and mat2 shapes cannot be multiplied (28x28 and 784x10)