You are currently trying to pass pred and label to the initialization of nn.MSELoss.
Use the functional API instead (F.mse_loss) or initialize the criterion before using it:
criterion = nn.MSELoss()
...
optimizer.zero_grad()
loss = criterion(pred, label)
...