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

Error in visualize code #6

Closed
elbamos opened this issue Feb 14, 2017 · 9 comments
Closed

Error in visualize code #6

elbamos opened this issue Feb 14, 2017 · 9 comments

Comments

@elbamos
Copy link

elbamos commented Feb 14, 2017

I'm seeing this:

TypeError: Don't know how to create Python object for N5torch8autograd8VariableE

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 15, in add_nodes
  File "<stdin>", line 15, in add_nodes
  File "<stdin>", line 15, in add_nodes
  File "<stdin>", line 15, in add_nodes
  File "<stdin>", line 11, in add_nodes

For reference with line numbers, I have the function as:

>>> def add_nodes(var):
...         print(var)
...         print("didthatone")
...         if var not in seen:
...             if isinstance(var, Variable):
...                 value = '('+(', ').join(['%d'% v for v in var.size()])+')'
...                 dot.node(str(id(var)), str(value), fillcolor='lightblue')
...             else:
...                 dot.node(str(id(var)), str(type(var).__name__))
...             seen.add(var)
...             if hasattr(var, 'previous_functions'):
...                 for u in var.previous_functions:
...                     print(u)
...                     dot.edge(str(id(u[0])), str(id(var)))
...                     add_nodes(u[0])
@szagoruyko
Copy link
Owner

hm that's weird. is this py2 or py3? can you post the network definition?

@elbamos
Copy link
Author

elbamos commented Feb 16, 2017 via email

@szagoruyko
Copy link
Owner

I haven't tested with py3, that might be the ussue. Do the notebooks run well for you? You can copy paste model definition code here or in gist

@Jackqu
Copy link

Jackqu commented Feb 27, 2017

I have the same error and I am using Python 2

@szagoruyko
Copy link
Owner

@apaszke do you have an idea maybe ?

@apaszke
Copy link

apaszke commented Mar 1, 2017

Yeah I think I know what's happening. We'll push a fix soon.

@apaszke
Copy link

apaszke commented Mar 1, 2017

Actually it should be fixed once pytorch/pytorch#881 is merged.

@SeougnSeon
Copy link

@szagoruyko My python version is 2.7. It works well. your visualize is very cool. thanks.

@szagoruyko
Copy link
Owner

fixed now, hopefully

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