Solved by vmirly1 in post #2 
              
              
                The first thing I would check in this situation is if the optimizer is defined correctly with the parameters of the model: 
optimize = optim.Adam(model.parameters(), ...)

It could be that there are two instances of model and optimizer is defined on one instance, while loss is computed on a differen…