Hey there.
I have a grayscale image as input and a grayscale image as output of my CNN. So the input should after enough epochs become similar to the ouput. But it just doesnt. The output seems to be pretty random. I tried more epochs and different learning rates but its always the same.
model = ConvNet().to(device)
criterion = nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr = learning_rate,weight_decay=0.00001)
for epoch in range(num_epochs):
print('epoch:' + str(epoch+1))

for i, (images,ground_truths) in enumerate(dataloader):

    print(i+1)

    images = images.to(device)

    ground_truths = ground_truths.to(device)

    #zero gradients

    optimizer.zero_grad()

    #forward pass

    output = model(images)

    probe = output.squeeze(0).squeeze(0)

    probe = torch.detach(probe).numpy()

    probe = np.asarray(probe)

    probe = 255*probe

    print(np.max(probe))

    print(probe,'\n')

    

    loss = criterion(output,ground_truths)  

    print(loss)

    

    #Backwardpropagation and optimization

    if epoch == 40:

      optimizer = torch.optim.Adam(model.parameters(), lr = learning_rate_2)

    loss.backward()

    optimizer.step()

torch.save(model,'first_net.pth')