Hi All,
I am performing Semantic segmentation I can print the loss during the iteration using the code below
for iter in range(num_epochs):
    print(iter)	
    for (i,l) in trainloader:
        i= i.to(device)
        l = l.to(device=device, dtype=torch.int64)
        outt = model(i)
        loss = criterion(outt['out'], l.squeeze(1))
        print(loss)
        loss.backward()
        optimizer.step()

Is there a way to print out accuracy as well? Any help is appreciated
Thanks
Nishanth