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

Fix: adding import nececeary for using attention layers as bottlenecks #70

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

rasmuspjohansson
Copy link

Adding the following import
from fastai.layers import _get_norm
in order for the following code to be able to run

def BatchNormZero(nf, ndim=2, **kwargs):\n",
" "BatchNorm layer with nf features and ndim initialized depending on norm_type. Weights initialized to zero."\n",
" return _get_norm('BatchNorm', nf, ndim, zero=True, **kwargs)\n",

After this fix it becomes possible to train a timm model based unet with attention or double_attention as bottleneck

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@muellerzr
Copy link
Collaborator

Thanks!

@muellerzr muellerzr merged commit 145c048 into walkwithfastai:master Jul 3, 2024
1 check failed
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