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

ValueError: math domain error #10

Open
biesseck opened this issue Mar 6, 2021 · 0 comments
Open

ValueError: math domain error #10

biesseck opened this issue Mar 6, 2021 · 0 comments

Comments

@biesseck
Copy link

biesseck commented Mar 6, 2021

I'm trying to train YOLO on my own dataset, but in the 1st epoch, after 14 batches, it raises the following exception:

Traceback (most recent call last):
.
.
.
File "pytorch_custom_yolo_training/utils/utils.py", line 239, in build_targets
    tw[b, best_n, gj, gi] = math.log(gw / anchors[best_n][0] + 1e-16)
ValueError: math domain error

My images have the size 98x81, which is smaller than the default size (width=416, height=416) set in the .cfg file. Could it be a cause of the problem? Or is that related to an invalid pixel value of my images? I thought the image size wasn't the problem because it runs some batches normally before raising the error, so I believe the script resizes the input images to the default size or do some padding to fit it into the input layer. Is it right?

I've also tried reduce batch_size from 16 to 8, but got the same error. Any idea?

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

1 participant