Okay. I made the changes but now I am getting a runtime error:
RuntimeError: input and target have different number of elements: 
input[128 x 1 x 128 x 128] has 2097152 elements, while target[128 x 2 x 128 x 128] has 4194304 element

This is the code for my model architecture:
class ColorizerNet(nn.Module):

def __init__(self):
	super(ColorizerNet, self).__init__()
	self.layer1 = nn.Conv2d(1, 8, 2, 2)
	self.layer2 = nn.Conv2d(8, 16, 2, 2)
	self.layer3 = nn.ConvTranspose2d(16, 8, 2, 2)
	self.layer4 = nn.ConvTranspose2d(8, 1, 2, 2)


def forward(self, x):
	x = F.relu(self.layer1(x))
	x = F.relu(self.layer2(x))
	x = F.relu(self.layer3(x))
	x = F.relu(self.layer4(x))
	return x

Am I making any obvious errors here? If required, I can start a separate thread on this followup error.