Thank you so much!
I was also able to get it working in the lesson 13 example by changing the hook function itself in a similar way.
def hook_fn(self, module, input, output): self.features = to_gpu(torch.tensor(output,requires_grad=True))
And therefore not passing the features into V() in the loss function.
To anyone else searching, the symptom I had was originally a the fault listed above. I added in requires_grad=True in the loss functions and it would now run, but the loss did not change at all. I wasn’t sure if it was the images I was using, or the multipliers used in the loss function. But I guess a useful insight is that if there’s no change in loss at all, the gradient is not calculated all the way through?