I'm trying to implement CNN with the GTSRB dataset

Morphinepill: <p>Hello,<br>
I want to train a CNN model with the GTSRB dataset, I made the model (wth 43 classes and 3 channels)<br>
But I’m getting an error when I try to pass an image<br>
Here’s my network</p>
<pre><code class="lang-auto">class LeNet(Module):
    def __init__(self, numChannels, classes):
        # call the parent constructor
        super(LeNet, self).__init__()
        # initialize first set of CONV =&gt; RELU =&gt; POOL layers
        self.conv1 = Conv2d(in_channels=numChannels, out_channels=20,
            kernel_size=(5, 5))
        self.relu1 = ReLU()
        self.maxpool1 = MaxPool2d(kernel_size=(2, 2), stride=(2, 2))
        # initialize second set of CONV =&gt; RELU =&gt; POOL layers
        self.conv2 = Conv2d(in_channels=20, out_channels=50,
            kernel_size=(5, 5))
        self.relu2 = ReLU()
        self.maxpool2 = MaxPool2d(kernel_size=(2, 2), stride=(2, 2))
        # initialize first (and only) set of FC =&gt; RELU layers
        self.fc1 = Linear(in_features=4320, out_features=3774)
        self.relu3 = ReLU()
        # initialize our softmax classifier
        self.fc2 = Linear(in_features=3774, out_features=classes)
        self.logSoftmax = LogSoftmax(dim=1)
</code></pre>
<p>And here’s my training loop, the error appears at “pred = model(x)”</p>
<pre><code class="lang-auto">for e in range(0, EPOCHS):
    # set the model in training mode
    model.train()
    # initialize the total training and validation loss
    totalTrainLoss = 0
    totalValLoss = 0
    # initialize the number of correct predictions in the training
    # and validation step
    trainCorrect = 0
    valCorrect = 0
    # loop over the training set
    for (x, y) in trainDataLoader:
        # send the input to the device
        (x, y) = (x.to(device), y.to(device))
        # perform a forward pass and calculate the training loss
        pred = model(x)
        loss = lossFn(pred, y)
        # zero out the gradients, perform the backpropagation step,
        # and update the weights
        opt.zero_grad()
        loss.backward()
        opt.step()
        # add the loss to the total training loss so far and
        # calculate the number of correct predictions
        totalTrainLoss += loss
        trainCorrect += (pred.argmax(1) == y).type(
            torch.float).sum().item()
</code></pre>
<p>The whole project is in this github repository (the show5 method is just for testing, added later on):</p><aside class="onebox githubblob" data-onebox-src="https://github.com/MTurbaq-753/Street-Signs/blob/main/Street-Signs-2.ipynb">
  <header class="source">

      <a href="https://github.com/MTurbaq-753/Street-Signs/blob/main/Street-Signs-2.ipynb" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <h4><a href="https://github.com/MTurbaq-753/Street-Signs/blob/main/Street-Signs-2.ipynb" target="_blank" rel="noopener nofollow ugc">MTurbaq-753/Street-Signs/blob/main/Street-Signs-2.ipynb</a></h4>


      <pre><code class="lang-ipynb">{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "224b2627",
   "metadata": {},
   "outputs": [],
   "source": [
    "from torch.nn import Module\n",
    "from torch.nn import Conv2d\n",
    "from torch.nn import Linear\n",
    "from torch.nn import MaxPool2d\n",
    "from torch.nn import ReLU\n",
    "from torch.nn import LogSoftmax\n",
    "from torch import flatten"
   ]
  },
  {
   "cell_type": "code",
</code></pre>



  This file has been truncated. <a href="https://github.com/MTurbaq-753/Street-Signs/blob/main/Street-Signs-2.ipynb" target="_blank" rel="noopener nofollow ugc">show original</a>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>