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

Refactor SegformerFinetuner to Use on_validation_epoch_end Hook #280

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SRDdev
Copy link

@SRDdev SRDdev commented May 31, 2024

Description

This PR refactors the SegformerFinetuner class to ensure compatibility with PyTorch Lightning v2.0.0 by replacing the deprecated validation_epoch_end method with the on_validation_epoch_end hook. This change addresses the issue of maintaining compatibility with the latest PyTorch Lightning API.

Motivation:

  • PyTorch Lightning v2.0.0 has deprecated the validation_epoch_end method, necessitating this update.
  • This update ensures that validation metrics are computed and logged correctly using the new on_validation_epoch_end hook.

Relevant Links:

Dependencies:

  • None

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

  • Unit Testing: Ensured that all existing unit tests for the SegformerFinetuner class pass with the new implementation.
  • Integration Testing: Conducted end-to-end tests to verify that the validation metrics are correctly computed and logged at the end of each epoch.
  • Validation Outputs: Confirmed that validation outputs are properly cleared after each epoch to prevent data leakage.

Any specific deployment considerations

  • No specific deployment considerations are required for this change. The updates are backward-compatible and do not introduce breaking changes.

Docs

  • Docs updated? What were the changes:
    • No documentation updates were necessary as the changes are internal to the class implementation and do not affect the public API.

…d with on_validation_epoch_end for PyTorch Lightning v2.0.0 compatibility.
…d with on_validation_epoch_end for PyTorch Lightning v2.0.0 compatibility.
@CLAassistant
Copy link

CLAassistant commented Jul 12, 2024

CLA assistant check
All committers have signed the CLA.

@SRDdev SRDdev marked this pull request as draft July 12, 2024 19:36
@SRDdev SRDdev marked this pull request as ready for review July 12, 2024 19:36
@SRDdev SRDdev marked this pull request as draft July 12, 2024 19:37
@SRDdev SRDdev marked this pull request as ready for review July 12, 2024 19:37
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

Successfully merging this pull request may close these issues.

2 participants