Skip to content

Add an option for Dection Models to return cost in eval mode as well (validation, test loss) #1574

@Delaunay

Description

@Delaunay

We need to get the model cost in eval mode when we compute validation loss/cost for hyper parameter search.

At the moment eval mode only returns the detection without the loss/cost.
Which mean it is used as inference mode which is different than what people might want.

We can not use training mode to compute validation because of batchnorm and dropout.

The solution with the least code modification would be to add a new argument inference_mode in forward that would be true if we only need the detection and false if we want the loss/cost.
and change if self.training to if not inference_mode.

Few classes through out the torchvision.models.vision would need to be updated like so

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions