Optimise Python script to run TensorBoard and open a tab in the browser

M

Maaz Basar

Guest
I wrote this simple script to run TensorBoard and open a tab in my browser.

import os
import webbrowser

os.system('''python3 -m tensorboard.main --logdir='./logs' --port=6006''')

url = "http://localhost:6006/"
webbrowser.open_new_tab(url)


Problem is, the second half of the script doesn't run until I close TensorBoard in the terminal which then defeats the purpose of opening a tab.

I work around this by opening a tab first and then running TensorBoard. But this means that I have to refresh the page because TensorBoard isn't ready when the tab opens.

How can I optimise this so that it runs perfectly?

Continue reading...
 
Top