Scenario:
some time ago, when running the fast RCNN model in Google’s colab, there was no problem. Later, when using featurize to rent a server to run the model, the same code kept reporting the error “CUDA error: device side assert triggered”
these two days have driven me crazy. There are many blog articles about this situation on the Internet. Most of them say that the label is out of bounds, and some of them have problems in the calculation of loss function
I can only debug step by step, and I’d better solve my own problems.
'''When running with GPU, this function reports an error “CUDA error: device-side assert triggered”'''
perm1 = torch.randperm(positive.numel(), device=positive.device)[:num_pos]
perm2 = torch.randperm(negative.numel(), device=negative.device)[:num_neg]
'''After modification, change device to cpu'''
perm1 = torch.randperm(positive.numel(), device="cpu")[:num_pos]
perm2 = torch.randperm(negative.numel(), device="cpu")[:num_neg]
Make a record, hoping to help people in the same situation.
Read More:
- [Solved] Runtimeerror: CUDA error: device side assert triggered
- [Solved] CUDA error: device side assert triggered classification task error
- [Solved] torch Do Targer Detection Error: RuntimeError: CUDA error: device-side assert triggered
- Cuda Runtime error (38) : no CUDA-capable device is detected
- TensorFlow-gpu Error: failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
- [Solved] RuntimeError: CUDA error: invalid device ordinal
- TensorRT model quantization error: Error Code 1: Cuda Runtime (an illegal memory access was encountered)
- [Solved] CUDA error:-UserWarning: CUDA initialization: CUDA unknown error
- [Solved] UserWarning: CUDA initialization: CUDA unknown error
- [Solved] RuntimeError: CUDA error: out of memory
- [Solved] Pytorch loading model specified GPU card number error or failed to specify
- [Solved] Bringing up interface eth0: Error: No suitable device found: no device found for connection ‘System eth0’.
- Vitis-AI Generate a Quantitative Model: NotImplementedError
- Vscode uses /deep/ Syntax error [How to Solve]
- Audit reported an error: “the device settings could not be applied because of the following error: Mme device internal error“
- [Solved] std::max() error C2589: ‘(‘ : illegal token on right side of ‘::‘
- [Solved] Failed to allocate graph: MYRIAD device is not opened.
- Cv2.dnn read model error [How to Solve]
- [Solved] selenium.common.exceptions.WebDriverException: Message: An unknown server-side error
- [Solved] ENSP Failed to Start AR Device error code: 40