szagoruyko / pytorchviz

A small package to create visualizations of PyTorch execution graphs
MIT License
3.24k stars 279 forks source link

Error when running examples.ipynb #4

Closed xychen9459 closed 6 years ago

xychen9459 commented 6 years ago

When I run examples.ipynb, notebook shows me the following error message:

trace, _ = torch.jit.trace(model, args=(x,))
make_dot_from_trace(trace)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-95b4d4bfd5bf> in <module>()
      1 trace, _ = torch.jit.trace(model, args=(x,))
----> 2 make_dot_from_trace(trace)

/opt/anaconda-py/anaconda3/lib/python3.6/site-packages/torchviz/dot.py in make_dot_from_trace(trace)
    108     >>> dot = make_dot_from_trace(trace)
    109     """
--> 110     torch.onnx._optimize_trace(trace, False)
    111     graph = trace.graph()
    112     list_of_nodes = parse(graph)

TypeError: _optimize_trace() takes 1 positional argument but 2 were given

How to solve the problem?

eugenelet commented 6 years ago

Same problem here, any solution to this?

Jongchan commented 6 years ago

@eugenelet I guess it may work without the False argument. I am not running this particular code, but I am using the same function tho..

muralidharpettela commented 6 years ago

Same Problem here.Any solution to this?

derelearnro commented 6 years ago

Also me the same problem,


TypeError Traceback (most recent call last)

in () ----> 1 trace, _ = torch.jit.trace(model, args=(x,)) 2 make_dot_from_trace(trace) TypeError: 'function' object is not iterable
szagoruyko commented 6 years ago

fixed by #13