-
Notifications
You must be signed in to change notification settings - Fork 280
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
KeyError
in name = param_map[id(u)]
#21
Comments
Hi @hughperkins , it's been a while! you need to provide either None parameters, or * all * tensors that require grad in the graph, this will fix your example: torchviz.make_dot(outputs, params={**{'inputs': inputs}, **dict(h1.named_parameters())}) we should be either giving a better error message, or allow missing named nodes. |
Yes :)
Ah, ok. Awesome, thanks! Will give this a try :) |
I am getting this issue as well. Here is the final stacktrace line:
I tried: torchviz.make_dot(loss, params={**{'inputs': inputs}, **dict(model.named_parameters())}) And also: torchviz.make_dot(loss, params=dict(model.named_parameters())) But, I still got the same error. Is this user error on my part? My model is an SSD Multibox model where the predictions are a list of tensors of different sizes. I am wondering if that might be the issue and it doesn't work with |
Hi @szagoruyko ,I met the same error when i train my network using 'make_dot' function to visulize my nerual network structure. There are the errors as follow:
there are the 'make_dot' function in my code:
when i debuge my code, i found this line code |
@szagoruyko set None parameters works for me, thanks |
There's a hacky way to fix it |
When I run:
I get:
collectenv output:
The text was updated successfully, but these errors were encountered: