I am using TensorBoard 2.2.2 with PyTorch 1.4.0 and Python 3.7.4 on Windows 10 Home 1909
I added a model graph, which is rendered correctly, but I cannot download the image using the Download PNG button.
I get different results with different browsers:
Firefox 77.0.1 (64-bit): Download PNG button does nothing, no download is triggered.
Chrome 83.0.4103.61: Produces a file called png.html, which is blank when viewed in the browser an contains some HTML Code.
Opera 68.0.3618.125: same as Chrome
Microsoft Edge 44.18362.449.0: produces a file named ..png which is not actually PNG encoded (can't be opened as an image)
I have attached some samples. The graph should display a simple sequential model with 3 consecutive 2D convolutional layers.
Hi @carlocantcook! Thanks for the clear report. I can reproduce this.
Glancing at the code, I suspect that the d3.select("#graphdownload")
is not matching anything because of shadow DOM changes. I’ll take a look
on Monday.
Okay, I can confirm that if we hack in the correct #graphdownload link
then the downloaded file is valid—
diff --git a/tensorboard/plugins/graph/tf_graph_common/minimap.ts b/tensorboard/plugins/graph/tf_graph_common/minimap.ts
index 1e2d138ad..892917e84 100644
--- a/tensorboard/plugins/graph/tf_graph_common/minimap.ts
+++ b/tensorboard/plugins/graph/tf_graph_common/minimap.ts
@@ -164,7 +164,7 @@ module tf.scene {
// detached from the dom.
return;
}
- let $download = d3.select('#graphdownload');
+ let $download = d3.select((window as any).graphDownloadLink);
this.download = <HTMLLinkElement>$download.node();
$download.on('click', (d) => {
// Revoke the old URL, if any. Then, generate a new URL.
diff --git a/tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts b/tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts
index 49c48c11e..11630929c 100644
--- a/tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts
+++ b/tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts
@@ -240,6 +240,10 @@ namespace tf.graph.controls {
},
},
+ attached() {
+ (window as any).graphDownloadLink = this.$.graphdownload;
+ },
+
_xlaClustersProvided: function(
renderHierarchy: tf.graph.render.RenderGraphInfo | null
) {
—so it looks like this is all that’s going on. Fixing this properly
requires plumbing the reference through a few layers of Polymer
components, or otherwise refactoring it…
Is there any workaround to get a graph exported while this is being fixed?
I would also like to know if there's any workaround for this issue
We understand that this is an annoying frustration. At this moment, the TensorBoard team is busy migrating this and other plugins to Polymer 3: https://github.com/tensorflow/tensorboard/issues/3887
Any further investigation of this problem will need to wait until that migration is complete. (Please see recent PRs to follow along on the migration progress.)
Are there any updates on this? Or at least a workaround?
You can take screenshots. ^^
Von: Shyamant Achar notifications@github.com
Gesendet: Dienstag, 15. September 2020 10:47
An: tensorflow/tensorboard tensorboard@noreply.github.com
Cc: carlocantcook carloschmidt@t-online.de; Mention mention@noreply.github.com
Betreff: Re: [tensorflow/tensorboard] Graph "Download PNG" button not working with TensorBoard 2.2.2 (#3714)
Are there any updates on this? Or at least a workaround?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/tensorflow/tensorboard/issues/3714#issuecomment-692566744 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3OJDDHVAMPWMIYBDXKPTLSF4SYDANCNFSM4NVYRBCA .
I wish I could download my model graphs as SVG or at least PNG. Are there any updates?
Most helpful comment
I wish I could download my model graphs as SVG or at least PNG. Are there any updates?