From 276ff6f38d5a7e32399ae5ac4f016ac0dcc94673 Mon Sep 17 00:00:00 2001 From: Hazarre Date: Fri, 8 Oct 2021 16:08:43 +0800 Subject: [PATCH 1/2] Update models.py --- implementations/srgan/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementations/srgan/models.py b/implementations/srgan/models.py index b8efd3c0..4bff3de8 100644 --- a/implementations/srgan/models.py +++ b/implementations/srgan/models.py @@ -9,7 +9,7 @@ class FeatureExtractor(nn.Module): def __init__(self): super(FeatureExtractor, self).__init__() vgg19_model = vgg19(pretrained=True) - self.feature_extractor = nn.Sequential(*list(vgg19_model.features.children())[:18]) + self.feature_extractor = nn.Sequential(*list(vgg19_model.features.children())[:35]) def forward(self, img): return self.feature_extractor(img) From d632773cb16f0f7b804573e27c89d658264a89d7 Mon Sep 17 00:00:00 2001 From: Hazarre Date: Fri, 8 Oct 2021 16:20:15 +0800 Subject: [PATCH 2/2] update models.py no tanh at the end of con3 for the generator, just a convolution --- implementations/srgan/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementations/srgan/models.py b/implementations/srgan/models.py index 4bff3de8..7722a21d 100644 --- a/implementations/srgan/models.py +++ b/implementations/srgan/models.py @@ -59,7 +59,7 @@ def __init__(self, in_channels=3, out_channels=3, n_residual_blocks=16): self.upsampling = nn.Sequential(*upsampling) # Final output layer - self.conv3 = nn.Sequential(nn.Conv2d(64, out_channels, kernel_size=9, stride=1, padding=4), nn.Tanh()) + self.conv3 = nn.Conv2d(64, out_channels, kernel_size=9, stride=1, padding=4) def forward(self, x): out1 = self.conv1(x)