I am trying to run a depth map super resolution model on Google Colab.
However, when I run the model, none of my weights update at all, despite the loss being computed properly and all of the layers getting gradients.
I have compared each of the model’s named parameters before and after the optimizer.step() function, and all of them return True.
What is happening? What should I try first to fix this?
Part of my code looks like this:

def train(train_loader, val_loader, optimizer, scheduler, model, criterion, last_step, max_steps, model_out_path): 
for param_group in optimizer.param_groups:
    param_group["lr"] = learning_rate
model.train()
current_step = last_step + 1

train_interval = 50
val_interval = 250
save_interval = 2000

# optimization run
while True:
    for batch in train_loader:
        #optimizer.zero_grad()
        if current_step > max_steps:
            break

        if current_step % train_interval == 0:
            print("step ", current_step, " of ", int(max_steps))

        hYh, hDl, hDh = batch[0], batch[1], batch[2]
        hYh = hYh.float()
        hDl = hDl.float()
        hDh = hDh.float()

        if cuda:
            hYh = hYh.cuda()
            hDl = hDl.cuda()
            hDh = hDh.cuda()

        loss = criterion(model(hYh, hDl), hDh)    # now has multi scale # and forgot about indexing from the hapazard old implementation
        #optimizer.zero_grad()
        a = list(model.parameters())[0].clone()
        #optimizer.zero_grad()
        loss.backward()
        if current_step % train_interval == 0:
            print('loss: ', loss)
        '''
        if current_step % train_interval == 0:
            for param in model.parameters():
                print(param.grad.data.sum())
        '''
        optimizer.step()
        scheduler.step()    # learning rate decay set
        optimizer.zero_grad()

        b = list(model.parameters())[0].clone()
        '''
        if current_step % train_interval == 0:
            for i in range(0, len(a)):
                print(torch.equal(a[i].data, b[i].data))
        '''

        if current_step % val_interval == 0:
            print("===> Step[{}]: Loss: {}".format(current_step, loss.data))
            writer.add_scalar("Training Loss", loss.data, current_step)
            validate(val_loader, optimizer, model, criterion, current_step, save_interval)

        if current_step % save_interval == 0:
            save_checkpoint(model, optimizer, scheduler, current_step, model_out_path)

        current_step += 1