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

Implement validation loss during training #159

Open
sfmig opened this issue Apr 12, 2024 · 0 comments
Open

Implement validation loss during training #159

sfmig opened this issue Apr 12, 2024 · 0 comments

Comments

@sfmig
Copy link
Collaborator

sfmig commented Apr 12, 2024

Logging validation loss is trickier than expected due to the model we are using.

  • We are using fasterrcnn_resnet50_fpn_v2 that returns predictions only if set to eval
  • What can we do?
    • redefine eager_outputs() method of the parent class GeneralizedRCNN?
      • not sufficient, even if we hack this method the loss is still an empty dict when run in validation - probably we need to do something like this
    • use a custom forward method?
      • ptrblk to the rescue
      • probably this is our best bet, but I think it's more difficult than what Patrick suggests because all of the stages (rpn, roi_heads) behave the same as the "parent" network: they only return losses during training, detector_losses and proposal_losses are empty dicts if in eval mode.
      • this person reimplemented all the bits in an old version of the codebase, probably we can replicate (preferably without hacking torchvision directly).
    • use another model?
      • we could have a go at YOLO? v8 is the latest, v5 seems straightforward to add to our pipeline.
      • other options for detection available in pytorch here
      • A comparison of some convolutional approaches for detection here
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