---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
in ()
----> 1 loss = torch.nn.functional.cross_entropy(a,b,ignore_index=-1).to(device)
2 loss
/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction, label_smoothing)
3027 if size_average is not None or reduce is not None:
3028 reduction = _Reduction.legacy_get_string(size_average, reduce)
-> 3029 return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
3030
3031
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
Я пытался установить экспорт TORCH_USE_CUDA_DSA=1, но все равно возникла та же ошибка.
loss = torch.nn.functional.cross_entropy(a,b,ignore_index=-1) print(loss) [/code] Тогда ошибка: [code]--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) in () ----> 1 loss = torch.nn.functional.cross_entropy(a,b,ignore_index=-1).to(device) 2 loss
/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction, label_smoothing) 3027 if size_average is not None or reduce is not None: 3028 reduction = _Reduction.legacy_get_string(size_average, reduce) -> 3029 return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) 3030 3031
RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. [/code] Я пытался установить экспорт TORCH_USE_CUDA_DSA=1, но все равно возникла та же ошибка.