Skip to content

Model training on images w/o any objects #104

@felix-veth

Description

@felix-veth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions