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

'builtin_function_or_method' object has no attribute 'grad_fn' #38

Open
Meimeiainaonao opened this issue Dec 13, 2019 · 1 comment
Open

Comments

@Meimeiainaonao
Copy link

Thanks for your sharing!
But I meet this question about

` File "/home/meichen/PycharmProjects/CBAM /cbam+resnet/MODELS/model_resnet.py", line 282, in
make_dot(output.mean, params=dict(net.named_parameters()))
File "/home/meichen/anaconda3/envs/reidbaseline/lib/python3.6/site-packages/torchviz/dot.py", line 37, in make_dot
output_nodes = (var.grad_fn,) if not isinstance(var, tuple) else tuple(v.grad_fn for v in var)

AttributeError: 'builtin_function_or_method' object has no attribute 'grad_fn'
`

Pls help. Thank you very much.

@VaticanCameos99
Copy link

It has to be output.mean(). You missed the braces.

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

2 participants