Error in visualize code
elbamos opened this issue · 9 comments
elbamos commented
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 commented
hm that's weird. is this py2 or py3? can you post the network definition?
elbamos commented
Py3. What's the best way to post the network definition?
… On Feb 15, 2017, at 6:19 AM, Sergey Zagoruyko ***@***.***> wrote:
hm that's weird. is this py2 or py3? can you post the network definition?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
szagoruyko commented
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 commented
I have the same error and I am using Python 2
szagoruyko commented
@apaszke do you have an idea maybe ?
apaszke commented
Yeah I think I know what's happening. We'll push a fix soon.
apaszke commented
Actually it should be fixed once pytorch/pytorch#881 is merged.
SeougnSeon commented
@szagoruyko My python version is 2.7. It works well. your visualize is very cool. thanks.
szagoruyko commented
fixed now, hopefully