question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add_graph_onnx not working

See original GitHub issue

Maybe this is something that would be fixed with a new release on pip?

I had the following code:

writer.add_graph(model, images[:2])

I got the following warning:

± python a1_mnist_fashion.py
warning: Embedding dir exists, did you set global_step for add_embedding()?
You are using PyTorch==0.3, use add_graph_onnx()

so I changed my code to:

# add the graph to tensorboard for visualization
writer.add_graph_onnx(model)

and then I got:

± python a1_mnist_fashion.py
warning: Embedding dir exists, did you set global_step for add_embedding()?
Traceback (most recent call last):
  File "a1_mnist_fashion.py", line 129, in <module>
    writer.add_graph_onnx(model)
  File "/home/ahundt/.local/lib/python2.7/site-packages/tensorboardX/writer.py", line 377, in add_graph_onnx
    self.file_writer.add_graph_onnx(gg(prototxt))
  File "/home/ahundt/.local/lib/python2.7/site-packages/tensorboardX/graph_onnx.py", line 11, in gg
    m = onnx.load(fname)
  File "/home/ahundt/.local/lib/python2.7/site-packages/onnx/__init__.py", line 29, in load
    with open(obj, 'rb') as f:
TypeError: coercing to Unicode: need string or buffer, Net found
-> [1]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
amorguncommented, Feb 16, 2018

@lanpa Sadly add_graph() is not working with 0.3.1 because of signature mismatch:

  1. https://github.com/lanpa/tensorboard-pytorch/blob/0c9f7ba28b37e4f22f269e4350e1c5813a3b5634/tensorboardX/graph.py#L45 - two arguments are used
  2. https://github.com/pytorch/pytorch/blob/v0.3.1/torch/onnx/__init__.py#L78 - only one argument is allowed Also, that check does not allow to use add_graph() in 0.3.1. EDIT: It was fixed in https://github.com/lanpa/tensorboard-pytorch/pull/83, sorry for bothering you.
0reactions
lanpacommented, Feb 21, 2018

@ahundt please have a test~

Read more comments on GitHub >

github_iconTop Results From Across the Web

2016 Office - Insert Chart function not working
1. Clear Excel cache. a. · 2. Clear Office related KeyChain Access (Skip this step if your keychain is empty now):. a. ·...
Read more >
problem with torch.util.tensorboard add_graph() · Issue #24157
Error in the console of the browser when loading the graph. I have tried graphs generated in tensorflow and they worked, it is...
Read more >
Excel quirk: Will not create graph from certain data - Super User
The issue is very simple. In the "won't graph" table, the numbers are stored as text. To fix this, just retype the numbers,...
Read more >
Bug - Unity 2021 - Shader Graph not working
I'm in a brand spankin new project in Unity 2021.1.14f1 using 3D Sample Scene URP. I create a new shader graph > blank...
Read more >
Graph is not displaying when I enter the value in textbox using ...
I want to get the bar chart in the browser where its showing blank graph Its displaying blank graph to me whether I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found