tensorboardX: demo_graph.py error on pytorch 0.4.0
I tried running the demo_graph.py and got the following error.
python demo_graph.py
Traceback (most recent call last):
File "demo_graph.py", line 56, in <module>
w.add_graph(model, (dummy_input, ))
File "/home/dana/Desktop/tensorboard-pytorch/tensorboardX/writer.py", line 400, in add_graph
self.file_writer.add_graph(graph(model, input_to_model, verbose))
File "/home/dana/Desktop/tensorboard-pytorch/tensorboardX/graph.py", line 52, in graph
trace, _ = torch.jit.trace(model, args)
TypeError: 'function' object is not iterable
The return of torch.jit.trace is this wrapper, from this commit
I’m using the Python 3.6 on Ubuntu 16.04
torch==0.4.0built from sourcetensorboardX==1.1tensorboard==1.6.0
Edit: Updated my pytorch version
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 25 (8 by maintainers)
Why is this issue closed? Was anyone able to reproduce the issue with pytorch 0.4?
@lanpa I have fixed my error, the code write network to tensorboard must before
model.to(device)@lanpa Hi, I also tried running the demo_graph.py, but the graph on tensorboard is like
I don’t know why it performs like this and how to correctly show the graphs of the networks. I’m using the Python 3.5 on Ubuntu 14.04
torch==0.3.1fromcondatensorboardX=1.1tensorboard=1.6.0Edit: Wow, I missed the expanding button, so embarrassing =_=
@snehilverma41 notice the
expect error here:line in the output. To my understanding, this error is expected. Check the source code.Regarding your graph output, that seems like the correct graph for the LinearInLinear Module. To view graphs of other modules, try the
rundropdown in tensorboard:demo_graph.pyworks perfectly. But if I try to save my own model it gives this error:Error occurs, checking if it's onnx problem... Your model fails onnx too, please report to onnx team No graph savedAlso is this bug rectified now?
@danakianfar Thank you so much! Because I just installed TensorboardX from source, I thought your pull request has been merged, but not yet. I tried your code, it works great.