Solution: convert the index strength of the array to int
Example:
# original
length = [id2tags[i.item()] for i in y[0].cpu() if i.item() > 0]
# Modify to:
length = [id2tags[int(i.item())] for i in y[0].cpu() if i.item() > 0]
Read More:
- pytorch: RuntimeError CUDA error device-side assert triggered
- [Solved] RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors
- RTX 3090 Run pytorch Error: CUDA error: no kernel image is available for execution on the device
- [Solved] Pytorch Tensor to numpy error: RuntimeError: Can‘t call numpy() on Tensor that requires grad.报错
- Pytorch CUDA Error: UserWarning: CUDA initialization: CUDA unknown error…
- [Solved] RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at
- Pytorch directly creates a tensor on the GPU error [How to Solve]
- [Solved] PyTorch Lightning Error: KeyError: ‘hidden_states‘
- [Solved] Pytorch Error: AttributeError: ‘Tensor‘ object has no attribute ‘backword‘
- [Solved] D455 Depth Camera Error: keyerror: ‘frame_ device_ t‘
- [Solved] RuntimeError: cuda runtime error: device-side assert trigger
- [Solved] RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dim
- [DL Common Issue] RuntimeError: CUDA error 59: Device-side assert triggered
- Pytorch torch.cuda.FloatTensor Error: RuntimeError: one of the variables needed for gradient computation has…
- Normalize error: TypeError: Input tensor should be a float tensor…
- [Solved] raise KeyError(key) from err KeyError: ‘Dates‘
- [Solved] CUDA failure 999: unknown error ; GPU=-351697408 ; hostname=4f5e6dff58e6 ; expr=cudaSetDevice(info_.device_id);
- numpy.concatenate() 253rd; 38169Keyerror: 0 [How to Solve]
- [Solved] Pycharm paddle Error: Error: (External) CUDA error(35), CUDA driver version is insufficient for CUDA