Tensorboard: None Scalar Value


I’m currently struggling with a non-trivial scalar in tensorboard. The only peculiarity is that sometimes it cannot be defined (i.e. it has None value).

I would like to see it on my tensorboard and don’t find the following workarounds acceptable:

  1. Simply don’t write the value. If you do so, you won’t have a "gap" or any other noticeable mark on your graph (i.e. you won’t see the value is missing if you have lots of data)
  2. Simply write 0. 0 and None values of the metric have different meaning
  3. Write a predefined value. This is somehow acceptable, but it will influence the smoothed value and is not particularly elegant.

The current tensorboard API does not let me achieve what I want, so I’m all ears to your workaround suggestions.

One of the possible solutions might be to have the shape of the tick to be different, like in the following image from this question, but I can’t find the API to achieve that.

Desired Look of None values

Thank You for Your time, looking forward to Your replies.


Just write numpy.nan and it should meet all your needs:

  1. It won’t affect the smoothed value.
  2. The mark will be different.

Answered By – Qin Heyang

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published