Hello, I encountered the following error when running the training script:
AttributeError: 'NoneType' object has no attribute 'detach'
stats['mean_2d_grad'] = torch.stack([x.grad.detach() for x in stats['mean_2d']])
It seems that x.grad is None for the tensors in stats['mean_2d']. Could you clarify why this happens in your implementation, and how I should properly resolve it?
Thank you for your help! @mks0601

Hello, I encountered the following error when running the training script:
AttributeError: 'NoneType' object has no attribute 'detach'
stats['mean_2d_grad'] = torch.stack([x.grad.detach() for x in stats['mean_2d']])
It seems that x.grad is None for the tensors in stats['mean_2d']. Could you clarify why this happens in your implementation, and how I should properly resolve it?
Thank you for your help! @mks0601