@smth You can think this. However, I met another error called RuntimeError: tensors are on different GPUs
class _make_layer(nn.Module):
        def __init__(self, stage, input_channel):
                super(_make_layer, self).__init__()
                self.conv_down = nn.Conv2d(input_channel, 21, kernel_size=1)
                self.conv_add = nn.Conv2d(21, 1, kernel_size=1)
                self.stage = stage

        def forward(self, x):
                out_for_conv = []
                for layer in self.stage:
                        if isinstance(layer, nn.Conv2d):
                                x = layer(x)    #This line causes the error
                                out = self.conv_down(x)
                                out_for_conv.append(out)
                        else:
                                x = layer(x)
                out = out_for_conv[0]
                for idx in range(1, len(out_for_conv)):
                        out += out_for_conv[idx]
                out = self.conv_add(out)
                return x, out
class Model(nn.Module):
        def __init__(self):
                super(Model, self).__init__()
                self.vgg16_features = list(models.vgg16(pretrained=True).features.children())
                self.feature_stage1 = self.vgg16_features[0:5]
        def forward(self, x):
                out = []
                # stage1
                x1, out_stage1 = _make_layer(self.feature_stage1, 64)(x)
                out.append(out_stage1)

This is my code, I just use one gpu, but why it said that I have used more GPUs?