How to run Tensorboard from python scipt in virtualenv?

Using Tensorboard 2 API (2019):

from tensorboard import program

tracking_address = log_path # the path of your log file.

if __name__ == "__main__":
    tb = program.TensorBoard()
    tb.configure(argv=[None, '--logdir', tracking_address])
    url = tb.launch()
    print(f"Tensorflow listening on {url}")

Note: tb.launch() create a daemon thread that will die automatically when your process is finished

Leave a Comment

techhipbettruvabetnorabahisbahis forumu