Error reported by
pytroch when modifying the network:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1600, 16, 256]], which is output 0 of CudnnConvolutionBackward, is at version 1; expected version 0 instead
Solution 1:
Check all operations of the tensor that is reported as an error. If there is an addition or subtraction operation of x + = m
, x = x + m
, all operations shall be changed to the following format:
x = x.clone() + m
Read More:
- [Solved] RuntimeError: one of the variables needed for gradient computation has been modified by an inplace
- Pytorch torch.cuda.FloatTensor Error: RuntimeError: one of the variables needed for gradient computation has…
- [Solved] Pytorch error: RuntimeError: one of the variables needed for gradient computation
- [Solved] pytorch loss.backward() Error: RuntimeError: Function AddBackward0 returned an invalid gradient at index 1…
- [Solved] RuntimeError: function ALSQPlusBackward returned a gradient different than None at position 3, but t
- [Solved] RuntimeError An attempt has been made to start a new process
- [Solved] mindinsight modelart Error: RuntimeError: An attempt has been made to start a new process before…
- [Solved] PyQt: RuntimeError: wrapped C/C++ object has been deleted & has no attribute of flush in python
- RuntimeError: CUDA error: an illegal memory access was encountered
- [Solved] Python Error: An attempt has been made to start a new process before the current process has finished …
- [Solved] glove Error: RuntimeError: Vector for token b‘Strangeling‘ has 17 dimensions
- [Solved] ValueError: only one element tensors can be converted to Python scalars
- [Solved] RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place
- When sending an email, an error was reported: AttributeError:’list’ object has no attribute’encode’
- [Solved] RuntimeError: No application found. Either work inside a view function or push an application contex
- [Solved] RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation
- [Solved] AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- [Solved] RuntimeError: DefaultCPUAllocator: not enough memory: you tried to allocate 1105920 bytes.
- For the problem of rejecting old usage errors after numpy is updated, modified in numpy 1.20; for more details and guidance