-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
problem with torch.util.tensorboard add_graph() #24157
Comments
You need to close the writer or flush it.
I faced the same problem and had it posted in StackOverflow
Error in the console of the browser when loading the graph. I have tried graphs generated in tensorflow and they worked, it is only with pytorch ones, even the one provided in the tutorial for tensorboard in pytorch ( the one using torchvision). The log file does contain the graph, as I see it in its contents, and the script doesn't complain when saving it, it is just at visualising time at tensorboard. Let me know if you are able to visualise your graph. I can confirm that the issue with the Unhandled Promise Rejection does not happen in 1.1, I downgraded it to 1.1 and it worked, the graph is now showing on Tensorboard. Weirdly, the graph generated by 1.1 has only 124 elements, while the one by 1.2, there are 507. This is shown when verbose is True, and I am attaching the output in txt files generated by both. |
Still blank after refreshing |
Collecting environment information... OS: Mac OSX 10.14.6 Python version: 3.7 Versions of relevant libraries: |
If you check your log file, you will see it contains the graph, it is a different error than the first one mentioned by Ginsoda. Do you get a graph page in Tensorboard but the graph doesn't load? If you check your browser console does it say
Because in that case it is the same problem I am facing. I had to downgrade to v1.1, but the graph there is way more simpler and doesn't contain all the model. |
Hi all, |
I too am getting a graph page that is empty. I did flush and close the SummaryWriter. Note:
Configuration:
|
Note that I too get the same error when copying the example given in the PyTorch documentation: Only difference is that I am not using TensorBoard nightly, but the released TensorBoard 1.14.0. |
I'm having the same issue - any luck on tracing the issue? |
Getting the same problem as @alqbib and @rfejgin , im running the tutorial code located at https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html |
My hint is that this is due to the TensorBoard compat (non-TensorFlow case) issue we saw where the log directory doesn't update correctly. Fixed in tensorflow/tensorboard#2342. Unfortunately this didn't make it out for TensorBoard 1.14, so you have three options - (1) use TensorBoard nightly with the fix, (2) install TensorFlow to leverage that code path in TensorBoard or (3) restart TensorBoard periodically for it to pickup the changes. Please let us know if one of those options takes care of it. |
Same issue with TB nightly. I don't think it's (3) because this happens even when I restart TB after the graph dump is complete. Will try (2). |
Same issue with TensorFlow 1.14.0 |
Possibly related - see screenshot of error in the Chrome console above |
Interesting - you're right that Chrome console output is unusual. I wonder if our graph proto is somehow wrong in this case. @lanpa can you confirm the tutorial code works for you? Thanks. |
@lanpa: I wasn't sure what you meant by the thumbs-up - does the tutorial code work for you? |
cc @sanekmelnikov @natalialunova |
Can confirm the same issue with tutorial code as well as custom model.
tb-nightly (1.15.0a20190902) |
Stuck by the same issue, any news? |
It seems like some graphs cause this issue. A potential fix is at #25599 but we're still confirming. If you're willing to apply those changes locally and confirm it fixes your issue that would be great. |
Hi @orionr, I can confirm that tensorboard does show the graph now! thanks! |
Me too! thanks! |
In that case, landing the changes so they'll be in |
Works here too, thanks for the fix. |
Fix landed. Please confirm fixed in pytorch-nightly after the build tonight, but closing. |
Sorry, torch:1.3.0 nightly did not fix the issue on python 3.7. I will down grade to python 3.5 latter this week, to see if its still a problem. |
@dnovischi, thanks for letting us know 1.3 doesn't work. Can you post a piece of sample code that shows the issue? cc @lanpa @sanekmelnikov |
@orionr Here you go and thanks for the quick response. Update: However, I now get a warning when launching the tensorboard server: Also note that in the sample code, above, i forgot to close the summary-writer, tb.close() |
Was having the same problem. I think it's necessary to have tensorboard-2.0.0. I wasn't able to get it to work with tensorboard-1.14 and pytorch nightly build. Edit: Does now work with Python 3.6, tensorboard-2.0.0, pytorch-1.3.0dev20190925, Mac OS 10.14.6. |
@orionr Thank you for your guidance,I've just solved this problem. |
Also working with
|
I updated to
and it's still not working for me. (With the same web console log). During the graph creation, I get the following trace
|
@clefourrier can you try installing TensorBoard (not necessarily TensorFlow) v2.0 and see if that fixes things for you? |
As mentioned by others, I think we still need py 3.6. This worked for me:
py 3.5 works. py 3.7 doesn't work. |
@sanekmelnikov and @lanpa can we try py 3.7? Thanks. |
@orionr I should have mentioned that I'm running tensorboard nightly, sorry (tb-nightly - 2.0.0a20190915 ) |
Just tried with py3.7 and tb 2.0 locally with Mac and the example on https://pytorch.org/docs/stable/tensorboard.html worked for me. @clefourrier and @ysono can you try and isolate your respective errors? Maybe try the simple ResNet example above to see if that works for you. At this point it's unlikely we can get any fix in for the PyTorch 1.3 release coming soon, but happy to fix anything in the nightly once we've isolated things. |
I used 3.7 too and didn't have issues. Perhaps there is a specific op that is causing the issue? |
Thanks for the details. @lanpa, @J0Nreynolds and @sanekmelnikov are looking to improve this visualization with #26639 in 1.4 |
@orionr Thank you for your guidance,I've just solved this problem. |
@shayan113 Which problem have you solved? Ubuntu with |
Too bad that you needed to use tensorboardX instead of torch.utils.tensorboard, but happy you were able to unblock. @jonas154 did you try with 1.4? Thanks. |
@shschong Thanks for sharing your solution! @orionr So far 1.4 isn't released or? I wanted to wait till the release of the latest version. So far I'm using the Hiddenlayer tool https://github.com/waleedka/hiddenlayer |
Thank you all, I think everything is settled with PyTorch including visualization being top to down instead of left to right. This is my specs Ubuntu 18.04.3 LTS |
Update to pytorch 1.4 and tensorboard 2.1.0 with python 3.6, works well. |
I am using |
Hi @orionr @ptrblck My packages:
When I use
The error occurs:
And the traceback clearly shows the error happens when called Just confirmed, it has something to do with |
[Problem solved] I found it's the So here's the method for those who encounter the same issue: # setup the summary writer
train_data_sample, label_sample = iter(dataloader_train).next()
writer = SummaryWriter(args.summary_path, flush_secs=120)
with writer:
writer.add_graph(model.module,train_data_sample.to(device)) # model graph, with input |
I can confirm - after an update to pytorch 1.4 everything works for me. |
Looks like we are at a good spot with PyTorch 1.4, so closing. Please open a new issue if you continue to have problems and thanks. |
code
🐛 Bug
log_dir is right
But tensorboard shows nothing !!
Does anyone encounter the same problem?
To Reproduce
Expected behavior
Environment
conda
,pip
, source): pipAdditional context
The text was updated successfully, but these errors were encountered: