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

JIT trace does not work with PyTorch 1.0 #27

Open
szagoruyko opened this issue Jan 31, 2019 · 3 comments
Open

JIT trace does not work with PyTorch 1.0 #27

szagoruyko opened this issue Jan 31, 2019 · 3 comments

Comments

@szagoruyko
Copy link
Owner

ERROR: test_mlp_make_dot_from_trace (__main__.TestTorchviz)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test.py", line 27, in test_mlp_make_dot_from_trace
    dot = make_dot_from_trace(trace)
  File "/Users/szagoruyko/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 133, in make_dot_from_trace
    list_of_nodes = parse(graph)
  File "/Users/szagoruyko/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 99, in parse
    inputs = [replace(i.uniqueName(), scope) for i in n.inputs()]
  File "/Users/szagoruyko/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 99, in <listcomp>
    inputs = [replace(i.uniqueName(), scope) for i in n.inputs()]
  File "/Users/szagoruyko/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 80, in replace
    return '/'.join([scope[name], name])
KeyError: 'input.1'

the solution is probably somewhere in https://github.com/lanpa/tensorboardX/blob/master/tensorboardX/pytorch_graph.py#L188

@qianyuzqy
Copy link

Hello! I have the same problem. The JIT Trace does not work with PyTorch 1.0. And I updated my pytorch_graph.py in tensorboardX as you said in https://github.com/lanpa/tensorboardX/blob/master/tensorboardX/pytorch_graph.py#L188
, but it dosen't work at all.
Traceback (most recent call last): File "/home/zhouqy/home/zhouqy/tmp/Mofan_Pytorch/hello/test.py", line 38, in <module> make_dot_from_trace(trace) File "/home/zhouqy/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 133, in make_dot_from_trace list_of_nodes = parse(graph) File "/home/zhouqy/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 99, in parse inputs = [replace(i.uniqueName(), scope) for i in n.inputs()] File "/home/zhouqy/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 99, in <listcomp> inputs = [replace(i.uniqueName(), scope) for i in n.inputs()] File "/home/zhouqy/anaconda3/lib/python3.6/site-packages/torchviz/dot.py", line 80, in replace return '/'.join([scope[name], name]) KeyError: 'input.1'

@rojinsafavi
Copy link

any updates?

@afqueiruga
Copy link

I think I fixed this one in the PR I just submitted.

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

4 participants