Solved by ptrblck in post #4 
              
              
                The dropout is used as a module, you could replace it with nn.Identity. Alternatively, if it’s used via the functional API, you could override the forward method and reimplement it. 
I still think this might be the faster and cleaner approach than to manipulate the original model and rebuild torchvi…