Solved by simaiden in post #2 
              
              
                Have you tried something like 
import torch
import torch.nn as nn
from torchvision import models

class MyNewModel(nn.Module):
  def __init__(self):
     super(MyNewModel, self).__init__()
     self.resnet = models.resnet18(pretrained=True)
     self.out = nn.Sequential([nn.Conv2d(...) , nn.Sigmoid(…