CDMA icon indicating copy to clipboard operation
CDMA copied to clipboard

one issue about code.

Open 7tu opened this issue 2 years ago • 7 comments

Thank you very much for your excellent work, which has benefited me a lot. I have encountered some problems when replicating your code and would like to consult you. The errors are as follows. If possible, would you like to tell me how to solve this problem? Sorry for taking up your time. We hope to get your reply as soon as possible. Thank you again. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [866,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [4,0,0], thread: [480,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [4,0,0], thread: [992,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [4,0,0], thread: [224,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [4,0,0], thread: [736,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [613,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [615,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [96,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [98,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [102,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [353,0,0] Assertion t >= 0 && t < n_classes failed. ../aten/src/ATen/native/cuda/NLLLoss2d.cu:103: nll_loss2d_forward_kernel: block: [2,0,0], thread: [356,0,0] Assertion t >= 0 && t < n_classes failed.

return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: CUDA error: device-side assert triggered

7tu avatar Nov 14 '23 09:11 7tu

This error may occur because the dimension mismatch of prediction of networks and ground truth.

lanfz2000 avatar Nov 16 '23 02:11 lanfz2000

Thank you very much for your reply. I am currently using the DigestPath2019 data set. Should it be a binary classification problem? The code is based on the code published on your github. First, move_file.py and slide_window.py are executed for data preparation, and then run.sh is run. This error appears. The error location is during cross_entropy calculation. I saw that num_class is also set to 2 in the code, which should be consistent. I tried mapping the label value to two values ​​0 and 1 and then performing cross_entropy calculation. In this way, the cross_entropy function executed smoothly, but the same error occurred in other places. This bothers me too. Sorry to bother you again, thank you again for your excellent work and look forward to hearing from you.

7tu avatar Nov 16 '23 03:11 7tu

Yes, it may be the problem of ground truth. Make sure it has two values, 0 and 1, not 0 and 255.

lanfz2000 avatar Nov 16 '23 08:11 lanfz2000

I have set the values to 0 and 1, but the same error still occurs elsewhere, could you please tell me if you have done any additional operations, if so, would you mind sharing them?

7tu avatar Nov 18 '23 06:11 7tu

I am sorry I did not make the error you have, maybe you can check the dataset.

lanfz2000 avatar Nov 21 '23 02:11 lanfz2000

The problem may indeed lie in the dataset. Can you share the dataset to my email address [email protected], because the official online download channel has been closed. Thank you again for your great work.

7tu avatar Nov 21 '23 08:11 7tu

Hi~Can you share the dataset to my email address [email protected], because the official online download channel has been closed. Thank you again for your great work.

hqy2020 avatar Jan 30 '24 02:01 hqy2020