Error in pytorch1.6 training:
RuntimeError: CUDA error: an illegal memory access was encountered
The reason for the error is the same as that of the lower version of python (such as version 1.1)
Runtimeerror: expected object of backend CUDA but get backend CPU for argument https://blog.csdn.net/weixin_ 44414948/article/details/109783988
Cause of error:
The essence of this kind of error reporting is model and input data_ image、input_ Label) is not all moved to GPU (CUDA).
* * tips: * * when debugging, you must carefully check whether every input variable and network model have been moved to the GPU. I usually report an error because I have missed one or two of them.
resolvent:
Model, input_ image、input_ The example code is as follows:
model = model.cuda()
input_image = input_iamge.cuda()
input_label = input_label.cuda()
or
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = model.to(device)
input_image = input_iamge.to(device)
input_label = input_label.to(device)
Read More:
- Runtimeerror using Python training model: CUDA out of memory error resolution
- ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256,
- FCOS No CUDA runtime is found, using CUDA_HOME=’/usr/local/cuda-10.0′
- CUBLAS_STATUS_ALLOC_FAILED
- Attribute Error: ‘XXX‘ object has no attribute ‘module‘
- Pytorch RuntimeError CuDNN error CUDNN_STATUS_SUCCESS (How to Fix)
- Build your own resnet18 network and load torch vision’s own weight
- RuntimeError: CUDA error: out of memory solution (valid for pro-test)
- Usage of Python dropout
- RuntimeError: reciprocal is not implemented for type torch.cuda.LongTensor
- Solve runtimeerror: reduce failed to synchronize: device side assert triggered problem
- (Solved) pytorch error: RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED (install cuda)
- RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`
- The difference of. Pt,. PTH,. Pkl and the way to save the model
- Solution to unbalanced load of multiple cards (GPU’s 0 card is too high) in Python model training (simple and effective)
- RuntimeError: cuDNN error: CUDNN_ STATUS_ EXECUTION_ Failed solutions
- Problem: attributeerror: ‘tensor’ object has no attribute ‘creator’
- torch.cuda.is_ Available() returns false
- InternalError: Failed to create session. Error and solution
- How to install cuda10.01in Ubuntu18.04