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

Trainers: support nn.Module as input #2614

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

Conversation

adamjstewart
Copy link
Collaborator

Want to use a model that does not yet exist in TorchGeo? Now you can pass it directly to the trainer class.

  • Code
  • Testing

@adamjstewart adamjstewart added this to the 0.7.0 milestone Feb 28, 2025
@adamjstewart adamjstewart requested a review from nilsleh February 28, 2025 11:51
@github-actions github-actions bot added the trainers PyTorch Lightning trainers label Feb 28, 2025
@adamjstewart
Copy link
Collaborator Author

Unit tests have revealed that this idea doesn't actually work. We can't store model in self.model because we haven't yet called super().__init__(), but that calls configure_models which needs access to self.models. And we can't store model in self.hparams because it doesn't support nn.Module. Need to think of a clever way to break this dependency loop...

@github-actions github-actions bot added the testing Continuous integration testing label Mar 11, 2025
@adamjstewart adamjstewart removed this from the 0.7.0 milestone Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Continuous integration testing trainers PyTorch Lightning trainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant