Skip to content

tensorboard

start_tensorboard()

Starts a tensorboard server in the background.

Returns:

Name Type Description
process Popen

The process of the tensorboard server.

Examples:

>>> process = start_tensorboard()
Source code in spotPython/utils/tensorboard.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def start_tensorboard() -> subprocess.Popen:
    """Starts a tensorboard server in the background.

    Returns:
        process: The process of the tensorboard server.

    Examples:
        >>> process = start_tensorboard()

    """
    cmd = ["tensorboard", "--logdir=./runs"]
    process = subprocess.Popen(cmd)
    return process

stop_tensorboard(process)

Stops a tensorboard server.

Parameters:

Name Type Description Default
process Popen

The process of the tensorboard server.

required

Returns:

Type Description
None

None

Examples:

>>> process = start_tensorboard()
>>> stop_tensorboard(process)
Source code in spotPython/utils/tensorboard.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def stop_tensorboard(process) -> None:
    """Stops a tensorboard server.

    Args:
        process (subprocess.Popen):
            The process of the tensorboard server.

    Returns:
        None

    Examples:
        >>> process = start_tensorboard()
        >>> stop_tensorboard(process)
    """
    process.terminate()