Solved by ptrblck in post #2 
              
              
                You are rewrapping the input in a new tensor, which will break the computation graph and thus your input won’t get any gradients in this line of code: 
model.feature_extractor(torch.tensor(x.view(1, -1)))

Use this instead and it should work: 
model.feature_extractor((x.view(1, -1))

You should also…