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

SwinTransformer' object has no attribute 'pos_drop' #214

Open
Sridhar-Ranganaboina opened this issue Jun 6, 2023 · 4 comments
Open

SwinTransformer' object has no attribute 'pos_drop' #214

Sridhar-Ranganaboina opened this issue Jun 6, 2023 · 4 comments

Comments

@Sridhar-Ranganaboina
Copy link

getting error pos_drop attribute is not available

@0chandansharma
Copy link

Hi @Sridhar-Ranganaboina ,

This "SwinTransformer' is implemented in "timm" library, in the new release the 'pos_drop' might be removed
better to downgrade to some older version it should pass.

@poetaster
Copy link

poetaster commented Sep 18, 2023

Hi @Sridhar-Ranganaboina ,

This "SwinTransformer' is implemented in "timm" library, in the new release the 'pos_drop' might be removed better to downgrade to some older version it should pass.

EDIT: wrong repo, sorry!

I tried creating a custom env with conda, but it's not even possible to install the libraries as listed. any idea for a patch?

@rafikoham
Copy link

There's this forward function on the model.py of Donut ([/usr/local/lib/python3.10/dist-packages/donut/model.py])
Here's the code :
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""
Args:
x: (batch_size, num_channels, height, width)
"""
x = self.model.patch_embed(x)
x = self.model.pos_drop(x)
x = self.model.layers(x)
return x

Maybe we can comment the x = self.model.pos_drop(x) ?
Or we should notify some contributors on the SwinTransformer forward function?

@serser
Copy link

serser commented Mar 9, 2024

pos_drop is still in v0.6.13 of timm and removed after v0.9:

https://github.com/huggingface/pytorch-image-models/blob/2696eedd1b1763b9da06e68c1af3c5ed360fe687/timm/models/swin_transformer.py#L474

I downgraded to v0.6.13 stable and it passes.

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

5 participants