-
Notifications
You must be signed in to change notification settings - Fork 259
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
Label and cross entropy ERROR #160
Comments
@2000LuoLuo The labels should be within the range of [0, 1]. It seems that your labels are out of this range. |
Thank you for your reply. Can you help me find out where the problem lies? The program I downloaded from RCF-PyTorch has almost no changes. but the same error is still reported. My environment is cuda12.1, pytroch2.4.1, even if I lower the The environment version and reducing the learning rate all have the same error, but I clearly use the same program as others. I look forward to your reply. Thank you. |
@2000LuoLuo Please use the provided data for training and don't modify the code. |
Yes, this is what I am confused about. I ran it exactly according to the usage instructions and downloaded the data set you provided. I only corrected the file path to the correct location and did not modify the other programs, but I still reported an error. I searched all night and still couldn't find the reason. |
@2000LuoLuo This may be because of the new version of PyTorch. I have made some modifications to the code. Please try it again. |
This is my problem, please help me.
How can I solve it?
C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Loss.cu:106: block: [107,0,0], thread: [117,0,0] Assertion target_val >= zero && target_val <= one failed.
C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Loss.cu:106: block: [107,0,0], thread: [118,0,0] Assertion target_val >= zero && target_val <= one failed.
C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Loss.cu:106: block: [107,0,0], thread: [119,0,0] Assertion target_val >= zero && target_val <= one failed.
C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Loss.cu:106: block: [6,0,0], thread: [12,0,0] Assertion target_val >= zero && target_val <= one failed.
C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\Loss.cu:106: block: [79,0,0], thread: [5,0,0] Assertion target_val >= zero && target_val <= one failed.
Traceback (most recent call last):
File "C:\Users\LHT\Desktop\RCF_Pytorch_Updated-master\train_RCF.py", line 353, in
main()
File "C:\Users\LHT\Desktop\RCF_Pytorch_Updated-master\train_RCF.py", line 221, in main
tr_avg_loss, tr_detail_loss = train(
File "C:\Users\LHT\Desktop\RCF_Pytorch_Updated-master\train_RCF.py", line 257, in train
loss = loss + cross_entropy_loss_RCF(o, label)
File "C:\Users\LHT\Desktop\RCF_Pytorch_Updated-master\functions.py", line 11, in cross_entropy_loss_RCF
mask[mask == 1] = 1.0 * num_negative / (num_positive + num_negative)
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.
The text was updated successfully, but these errors were encountered: