Image Classification Architeture

theojc15: <p>Im trying to make this architecture<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/6/867920b061160b98de6efd38273042b5f0432b60.png" data-download-href="https://discuss.pytorch.org/uploads/default/867920b061160b98de6efd38273042b5f0432b60" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/6/867920b061160b98de6efd38273042b5f0432b60_2_690x381.png" alt="image" data-base62-sha1="jbBuKk5TaxxvhctmuvY5iB79w1q" width="690" height="381" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/6/867920b061160b98de6efd38273042b5f0432b60_2_690x381.png, https://discuss.pytorch.org/uploads/default/original/3X/8/6/867920b061160b98de6efd38273042b5f0432b60.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/8/6/867920b061160b98de6efd38273042b5f0432b60.png 2x" data-dominant-color="E2D8D6"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">735×406 77.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Below is my code :<br>
class Net(nn.Module):<br>
def <strong>init</strong>(self):<br>
super(Net, self).<strong>init</strong>()<br>
self.conv1 = nn.Conv2d(3, 64, kernel_size=5, stride=1, padding=1)<br>
self.conv2 = nn.Conv2d(64, 32, kernel_size=3, stride=1, padding=1)<br>
self.conv3 = nn.Conv2d(32, 16, kernel_size=3, stride=1, padding=1)</p>
<pre><code>    self.maxPool2d = nn.MaxPool2d(kernel_size=2, stride =2)
    self.flatten = nn.Flatten()
    
    self.fc1 = nn.Linear(784, 16)
    self.fc2 = nn.Linear(16, 26)

def forward(self, x):
    y = self.conv1(x)
    y = F.relu(y)
    y = self.maxPool2d(y)
    y = self.conv2(y)
    y = F.relu(y)
    y = self.maxPool2d(y)
    y = self.conv3(y)
    y = F.relu(y)
    y = self.maxPool2d(y)
    y = self.flatten(y)
    y = self.fc1(y)
    y = self.fc2(y)
    return y        
</code></pre>
<p>for epochs in range(epoch):<br>
print("Epoch : ", epochs)<br>
model.train() <span class="hashtag-raw">#training</span> loop<br>
running_loss = 0.0<br>
running_corrects = 0<br>
for inputs, labels in train_loader:<br>
inputs = inputs.to(device)<br>
labels = labels.to(device)<br>
optimizer.zero_grad()<br>
outputs = model(inputs)<br>
_, preds = torch.max(outputs,1)<br>
loss = criterion(outputs, labels)<br>
loss.backward()<br>
optimizer.step()<br>
running_loss += loss.item()/inputs.size(0)<br>
running_corrects += torch.sum(preds == labels.data)/inputs.size(0)</p>
<pre><code>    exp_lr_scheduler.step() #schedule the learning rate for next the epoch of training
    train_epoch_loss = running_loss / len(train_loader)
    train_epoch_acc = running_corrects / len(train_loader)

    model.eval() #validation loop

    running_loss = 0.0
    running_corrects = 0

    for inputs, labels in val_loader:
        inputs = inputs.to(device)
        labels = labels.to(device)
        outputs = model(inputs)
        _, preds = torch.max(outputs,1)
        loss = criterion(outputs, labels)
        running_loss += loss.item()/inputs.size(0)
        running_corrects +=torch.sum(preds == labels.data)/inputs.size(0)

    epoch_loss = running_loss / len(val_loader)
    epoch_acc = running_corrects.double() / len(val_loader)
print("Train: Loss: {:.4f} Acc: {:.4f}"
" Val: Loss: {:.4f}"
" Acc: {:.4f}".format(train_epoch_loss,train_epoch_acc,epoch_loss,epoch_acc))
</code></pre>
<p>somehow it stucks on epoch 0 and doesn’t show the result even after an hour. I used the asl alphabet dataset. Can any one help me?</p>
<p>here is the full code : <a href="https://drive.google.com/file/d/1zWjrj2cslnIdj252uM1DFyzddMBHib8p/view?usp=sharing" rel="noopener nofollow ugc">https://drive.google.com/file/d/1zWjrj2cslnIdj252uM1DFyzddMBHib8p/view?usp=sharing</a></p>