-
Notifications
You must be signed in to change notification settings - Fork 51
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
AttributeError: 'function' object has no attribute 'named_parameters' #11
Comments
Have you tried installing the 2.4 version using directly the .whl file? |
how do i install directly from the .whl file? |
If you make the following modifications to the function
|
Change the import a bit like, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to pip install fastai==2.4 but couldn't as colab couldn't find 2.4 version of fastai. so i just installed pip install fastai. whenever i try to run the trained model, i get the error
AttributeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 net_G = build_res_unet(n_input=1, n_output=2, size=256)
2 net_G.load_state_dict(torch.load("res18-unet.pt", map_location=device))
3 model = MainModel(net_G=net_G)
4 train_model(model, train_dl, 20)
3 frames
/usr/local/lib/python3.10/dist-packages/fastai/vision/learner.py in _get_first_layer(m)
32 "Access first layer of a model"
33 c,p,n = m,None,None # child, parent, name
---> 34 for n in next(m.named_parameters())[0].split('.')[:-1]:
35 p,c=c,getattr(c,n)
36 return c,p,n
AttributeError: 'function' object has no attribute 'named_parameters'
please let me know how to fix it. Thanks.
The text was updated successfully, but these errors were encountered: