I had similar case. When I checked the loss value of inner model’s output after each epoch, it was different (decreasing). This means that the model weights are changing which implies the model is training. So, as far as you don’t use detach() the model2 is training. To verify, you can also return the output of model2() and check the loss value (or the vectors themselves) after each epoch. Something like the following:
class model1(torch.nn.Module):
    def __init__(self):
        super(model1, self).__init__()
        self.ReLU = ReLU(400, 128, 1)
        self.QoS = nn.Linear(128, 1)

    def forward(self, pixel):
        model2_out = model2(pixel.cuda())
        pixel = self.ReLU(model2_out)
        pixel = self.QoS(pixel)
        return model2_out, pixel

for idx, (raw_data, len_frame, true_mos) in enumerate(train_module):
            raw_data = raw_data.to(device).float()
            true_mos = true_mos.to(device).float()
            optimizer.zero_grad()
            model2_out, outputs = model1(raw_data)
            if (idx == 0):
                print("model2_out:  ", model2_out)
            loss = criterion(outputs, true_mos)
            loss.backward()
            optimizer.step()

but if you have the ground truth data for model2 output, you can check loss value instead of the tensor values. Hope this helps