When self.gradients is None, nothing seems to get called or registered, consequently nor do my prints inside my hook . forward() just returns and I later get a nice AttributeError: 'NoneType' object has no attribute 'cpu' because self.gradients was None (here I do guided_gradients = self.GradCAM.gradients.cpu().data.numpy()[0])
Are there any subtle edge cases where a hook wouldn’t be properly registered? i.e. if a layer is somehow “un-hookable”?