I had to do a lot of changes to make it start training…
      for i, data in enumerate(dataloader):
        
        inps, labs = data
        inps, labs = inps.cuda(args['device']), labs.cuda(args['device'])

        inps = Variable(inps).cuda(args['device'])
        labs = Variable(labs).cuda(args['device'])
        optimizer.zero_grad()
        outs = net(inps.permute(0, 3, 1, 2).float())
        soft_outs = F.softmax(outs, dim=1)
        prds = soft_outs.data.max(1)[1]
        loss = criterion(outs, labs)
        loss.backward()
        optimizer.step()
        prds = prds.cpu().numpy()
        inps_np = inps.detach().cpu().numpy()
        labs_np = labs.detach().cpu().numpy()
        train_loss.append(loss.data.item
                        ())
        print('[epoch %d], [iter %d / %d], [train loss %.5f]' % (epoch, i + 1, len(dataloader), np.asarray(train_loss).mean()))