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

[WIP] Add torchgeo models #233

Merged
merged 44 commits into from
Jan 6, 2025
Merged

[WIP] Add torchgeo models #233

merged 44 commits into from
Jan 6, 2025

Conversation

paolofraccaro
Copy link
Collaborator

Added different models as implemented in torchgeo. Added a related test file and passing all other tests. Only issue is mmseg installation imcompatible with updated version of timm.

@paolofraccaro paolofraccaro linked an issue Nov 12, 2024 that may be closed by this pull request
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
@Joao-L-S-Almeida
Copy link
Member

By running the automatic tests pytest -s tests/test_encoder_decoder_torchgeo_models.py::test_create_pixelwise_model_dofa, I see the error:
FAILED tests/test_encoder_decoder_torchgeo_models.py::test_create_pixelwise_model_dofa[True-IdentityDecoder-segmentation-expected1-dofa_large_patch16_224] - AttributeError: 'DOFA' object has no attribute 'embed_dim'
In fact, the dofa model here:
terratorch/models/backbones/dofa_vit.py:64: in init
self.out_channels = [self.dofa_model.embed_dim] * len(self.out_indices)
has no attribute called embed_dim.
I'm using timm==0.9.7 and Python 3.12.

Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
@Joao-L-S-Almeida
Copy link
Member

Joao-L-S-Almeida commented Nov 22, 2024

@paolo-fraccaro Should we replace the current torchgeo version from requirements and pyproject.toml by:
torchgeo @ git+https://github.com/microsoft/torchgeo?

@paolofraccaro
Copy link
Collaborator Author

@Joao-L-S-Almeida I think it makes sense to get the latest. Or is there a way to point to a specific commit?

@Joao-L-S-Almeida
Copy link
Member

Joao-L-S-Almeida commented Nov 26, 2024

@paolo-fraccaro It's possible to add the hash at the end: pip install git+https://github.com/microsoft/torchgeo@a5d3037864df8851e2efce6c9ee8134ecf6b1106

@paolofraccaro
Copy link
Collaborator Author

OK that may be the best solution.

@paolofraccaro
Copy link
Collaborator Author

Please also check if there is any other library that requires the same approach.

Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
@Joao-L-S-Almeida
Copy link
Member

@paolo-fraccaro I tried to use the latest torchgeo but:
ERROR: Cannot install torchgeo 0.7.0.dev0 (from git+https://github.com/microsoft/torchgeo) and torchgeo 0.7.0.dev0 (from git+https://github.com/microsoft/torchgeo.git) because these package versions have conflicting dependencies.

@romeokienzler romeokienzler self-requested a review December 2, 2024 12:25
@romeokienzler romeokienzler changed the title Add torchgeo models [WIP] Add torchgeo models Dec 5, 2024
@romeokienzler romeokienzler marked this pull request as draft December 5, 2024 14:50
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
@romeokienzler romeokienzler marked this pull request as ready for review January 6, 2025 10:08
Copy link
Collaborator

@romeokienzler romeokienzler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romeokienzler romeokienzler merged commit b730eba into main Jan 6, 2025
3 of 7 checks passed
@romeokienzler romeokienzler deleted the add_torchgeo_models branch January 6, 2025 10:45
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.

Add torchgeo pretrained backbones/FMs
4 participants