hey, I encountered an error when running the register_backward_hook
firstly, its just a warning:
_UserWarning: Using a non-full backward hook when the forward contains multiple autograd Nodes is deprecated and will be removed in future versions. This hook will be missing some grad_input. Please use register_full_backwardhook to get the documented behavior.
it's deprecated after 1.8.0 so I replace the _register_backwardhook with _register_full_backwardhook as told, but this time I get an error:
RuntimeError: Output 0 of BackwardHookFunctionBackward is a view and is being modified inplace. This view was created inside a custom Function (or because an input was returned as-is) and the autograd logic to handle view+inplace would override the custom backward associated with the custom Function, leading to incorrect gradients. This behavior is forbidden. You can fix this by cloning the output of the custom Function. I googled for a long time and still didnt get a good resolution.
Do you have any idea?
and I am using:
PyTorch: 1.10.0
torchvision 0.11.2
Python 3.9.7
OS: ubuntu1804
hey, I encountered an error when running the register_backward_hook firstly, its just a warning: _UserWarning: Using a non-full backward hook when the forward contains multiple autograd Nodes is deprecated and will be removed in future versions. This hook will be missing some grad_input. Please use register_full_backwardhook to get the documented behavior. it's deprecated after 1.8.0 so I replace the _register_backwardhook with _register_full_backwardhook as told, but this time I get an error: RuntimeError: Output 0 of BackwardHookFunctionBackward is a view and is being modified inplace. This view was created inside a custom Function (or because an input was returned as-is) and the autograd logic to handle view+inplace would override the custom backward associated with the custom Function, leading to incorrect gradients. This behavior is forbidden. You can fix this by cloning the output of the custom Function. I googled for a long time and still didnt get a good resolution. Do you have any idea?
and I am using: PyTorch: 1.10.0 torchvision 0.11.2 Python 3.9.7 OS: ubuntu1804