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

fix: dont try to open browser when headless #1648

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions library/tensorboard_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ def start_tensorboard(logging_dir, wait_time=5):
log.error('Failed to start Tensorboard:', e)
return

# Wait for some time to allow TensorBoard to start up
time.sleep(wait_time)

# Open the TensorBoard URL in the default browser
log.info('Opening tensorboard url in browser...')
webbrowser.open('http://localhost:6006')
# Check if DISPLAY variable is set, if it is, then open TensorBoard in browser
if os.environ.get('DISPLAY') is not None:

# Wait for some time to allow TensorBoard to start up
time.sleep(wait_time)

# Open the TensorBoard URL in the default browser
log.info('Opening tensorboard url in browser...')
webbrowser.open('http://localhost:6006')


def stop_tensorboard():
Expand Down
Loading