Closed Secret813 closed 11 months ago
[2023-11-27 18:16:25,627][ INFO] ===========> Epoch: 0, LR: 0.00500, Previous best: 0.00
../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:365: operator(): block: [1104,0,0], thread: [64,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.
../aten/src/ATen/native/cuda/ScatterGatherKernel.cu:365: operator(): block: [1104,0,0], thread: [65,0,0] Assertion idx_dim >= 0 && idx_dim < index_size && "index out of bounds"
failed.
这应该是你希望scatter的类别的index大于了你one-hot规定的最大的类别(最大类别index似乎是18?(19-1)),可以检查一下你的inputs
这个变量
非常感谢!
您好,我想对您的项目做一些实验,增加了一个模块用到了 `def label_onehot(inputs, num_segments): batch_size, im_h, im_w = inputs.shape
remap invalid pixels (-1) into 0, otherwise we cannot create one-hot vector with negative labels.
这一函数。运行的时候报错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. 定位后报错出现在了上面这段函数。具体为:
File "unimatch.py", line 288, in <module> main() File "unimatch.py", line 209, in main mask_l = F.interpolate(label_onehot(mask_x, 19),size=preds.shape[2:], mode='nearest') File "/root/UniMatch2/supervised.py", line 95, in label_onehot return outputs.scatter_(1, inputs.unsqueeze(1), 1.0) RuntimeError: CUDA error: device-side assert triggered
请问您知道如何解决嘛?