Skip to content
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

How to show indented json string with tf.summary.text? #4247

Closed
SunDoge opened this issue Oct 19, 2020 · 3 comments
Closed

How to show indented json string with tf.summary.text? #4247

SunDoge opened this issue Oct 19, 2020 · 3 comments

Comments

@SunDoge
Copy link

SunDoge commented Oct 19, 2020

I want to show indented json string in tensorboard, for example,

{
  "batch_size": 64,
  "model": {
    "arch": "resnet50"
  },
  "num_epochs": 200,
  "num_workers": 4
}

but all I get is a single line:

image

Is there any way I can show the json string in multiline?

@bileschi
Copy link
Collaborator

Hello @SunDoge,

Thanks for your interest in TensorBoard! The text dashboard does not allow for formatted text. However, from the content of the text itself, it seems like you are trying to store some tree formatted data about the experiment itself. Can you say more about your use case? Is it the case you are trying to store enough information to be able to go back and determine which results are associated with what computational / algorithmic settings? If so, you may be interested in what the hparams dashboard provides.

https://www.tensorflow.org/tensorboard/hyperparameter_tuning_with_hparams

If that does not suffice, please respond with what would be better.

Thanks!

@nfelt
Copy link
Contributor

nfelt commented Oct 19, 2020

Actually the text dashboard does allow formatted text - the text is interpreted as markdown, including support for certain HTML tags. To get the formatting you want, just wrap your text output in <pre> </pre> (as described in #830).

@SunDoge
Copy link
Author

SunDoge commented Oct 20, 2020

Hi, @bileschi , thanks for your suggestion. I want to check my experimental config and compare config for different experiments using tensorboard. hparams is great but my config is nested and I have not yet reached the hyperparameter tuning stage.

And thank you @nfelt , you have solved my problem.

@SunDoge SunDoge closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants