-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
RuntimeError: CUDA error: device-side assert triggered #2124
Comments
False Alarm! It seems one or more of my test images were out of index, that means the labels were wrong, may be located out of the image. It would be good you add to the code something like Anyway, sorry for open this issue, completely my bad. |
@hdnh2006 that's interesting. There's a comprehensive set of tests the labels and images are required to pass before they are included in the train or val sets. You can find these here. If you can determine how your incorrect labels passed these checks we can update them or add an additional check: Lines 441 to 486 in 73a0669
|
@hdnh2006 the label checks are here (L461-L464), they should prevent any negative labels or labels with box values > 1: assert l.shape[1] == 5, 'labels require 5 columns each'
assert (l >= 0).all(), 'negative labels'
assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels'
assert np.unique(l, axis=0).shape[0] == l.shape[0], 'duplicate labels' |
Thanks @glenn-jocher, I saw it, your code is fantastic, elegant and easy to understand. I did not explain myself well, my problem was not exactly with the label, I mean class 0, 1, 2, 3... but with the square itself. I downloaded a dataset from internet and it seems that there were some images where the coordinates of the boxes matched with pixels that were outside of the image (just for little decimals), which caused all the controls of your code passed correctly but then it looked for a pixel that did not belong to the image in some step and skipped this error that it had nothing to do with the message being returned (CUDA or something like that). This kind of control would be awesome if it is incorporated to your code but I think it is not a very common error. I don't know if I explained good, let me know if you have any doubt and thanks again for this fantastic tool you have created. Best, H. |
@hdnh2006 non-normalized or out of bounds coordinate labels will cause the entire image and label to fail it's check, and this image will not be included in training. These checks are run in xywh image space, are you suggesting that we should also run the checks in a seperate image space such as xyxy? assert (l >= 0).all(), 'negative labels'
assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels' |
🐛 Bug
Hi! I am trying to train yolo into my own dataset.
It apparently runs the first epoch correctly but when it is going to evaluate the valid set, it fails, giving to me an error apparently related with CUDA but when you see the logs it seems the problem is with the boxes in the
general.py
code.At the beginning I thought the problem was I didn't have the last commit cloned, so I created a new virtualenv and cloned the last repo but the error was still there.
Then I modified the batch size to 2 and the error was the same.
Could you help me to fix this issue?
To Reproduce (REQUIRED)
Input:
Output:
Environment
1st Update
I read to use
CUDA_LAUNCH_BLOCKING="1"
beforepython train.py
in order to get the CUDA logs and these are the logs I am getting for:2nd Update
Due to the problem was while trying to evaluate the valid dataset, I added '-notest' to the command and now I don't receive any output, it seems it is still working, the memory of my GPU increased from 4GB to 6GB in this step but the percentage of use went to almost 0:
The text was updated successfully, but these errors were encountered: