Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one issue about code. #5

Open
7tu opened this issue Nov 14, 2023 · 7 comments
Open

one issue about code. #5

7tu opened this issue Nov 14, 2023 · 7 comments

Comments

@7tu
Copy link

7tu commented Nov 14, 2023

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

@lanfz2000
Copy link
Collaborator

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

@7tu
Copy link
Author

7tu commented Nov 16, 2023

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.

@lanfz2000
Copy link
Collaborator

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

@7tu
Copy link
Author

7tu commented Nov 18, 2023

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?

@lanfz2000
Copy link
Collaborator

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

@7tu
Copy link
Author

7tu commented Nov 21, 2023

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.

@hqy2020
Copy link

hqy2020 commented Jan 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants