-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update timm to 1.* version and support more encoders #885
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I've left some suggestions that fixed the tests on my side, since I am looking to use segmentation_models_pytorch with timm>1.0
in_channels: int = 3, | ||
depth: int = 5, | ||
output_stride: int = 32, | ||
out_indices: Optional[List[int]] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out_indices: Optional[List[int]] = None, | |
out_indices: Union[str, List[int]] = "first", |
if "encoder_indices" in kwargs and kwargs["encoder_indices"] is None: | ||
kwargs["encoder_indices"] = "first" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "encoder_indices" in kwargs and kwargs["encoder_indices"] is None: | |
kwargs["encoder_indices"] = "first" | |
if "out_indices" in kwargs and kwargs["out_indices"] is None: | |
kwargs["out_indices"] = "first" |
While it's called encoder_indices
in the function select_feature_indices
, in TimmUniversalEncoder
it is still called out_indices
encoder_indices = kwargs.pop("encoder_indices", None) | ||
if encoder_indices is not None: | ||
logger.warning( | ||
"Argument `encoder_indices` is supported only for `tu-` encoders (Timm) and will be ignored." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encoder_indices = kwargs.pop("encoder_indices", None) | |
if encoder_indices is not None: | |
logger.warning( | |
"Argument `encoder_indices` is supported only for `tu-` encoders (Timm) and will be ignored." | |
) | |
out_indices = kwargs.pop("encoder_indices", None) | |
if out_indices is not None: | |
logger.warning( | |
"Argument `out_indices ` is supported only for `tu-` encoders (Timm) and will be ignored." | |
) |
Hi @wouterzwerink thanks for the review! |
Make most of the models from timm compatible with decoders (including transformers and convnext models)