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

Model training on images w/o any objects #104

Open
felix-veth opened this issue Dec 18, 2024 · 0 comments
Open

Model training on images w/o any objects #104

felix-veth opened this issue Dec 18, 2024 · 0 comments

Comments

@felix-veth
Copy link

Hi,

In the forward path of the MultiBoxLoss() class the amount of present ground truth boxes in every image is calculated:

            n_objects = boxes[i].size(0)

            overlap = find_jaccard_overlap(boxes[i],self.priors_xy)  # (n_objects, 8732)

            # For each prior, find the object that has the maximum overlap
            overlap_for_each_prior, object_for_each_prior = overlap.max(dim=0)  # (8732) 

When I try to calculate the loss for images w/o any objects, this throws the following error:

IndexError: max(): Expected reduction dim 0 to have non-zero size.

I guess the current code doesn't work for a training dataset that contains empty images, right?

The used dataset for this tutorial (PascalVOCDataset) doesn't cover that case.

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