Skip to main content

TensorboardX

tip

If you are not already using ClearML, see Getting Started.

TensorboardX is a data visualization toolkit to log information through PyTorch and visualize it through TensorBoard. ClearML automatically captures all data logged to TensorboardX, including scalars, images, video, plots, and text. All you have to do is add two lines of code to your script:

from clearml import Task

task = Task.init(task_name="<task_name>", project_name="<project_name>")

This will create a ClearML Task that captures your script's information, including Git details, uncommitted code, python environment, your TensorboardX metrics, plots, images, and text.

View the TensorboardX outputs in the WebApp, in the experiment's page.

TensorboardX WebApp scalars

Automatic Logging Control

By default, when ClearML is integrated into your script, it captures all of your TensorboardX plots, images, metrics, videos, and text. But, you may want to have more control over what your experiment logs.

To control a task's framework logging, use the auto_connect_frameworks parameter of Task.init(). Completely disable all automatic logging by setting the parameter to False. For finer grained control of logged frameworks, input a dictionary, with framework-boolean pairs.

For example:

auto_connect_frameworks={
'tensorboard': False,'matplotlib': False, 'tensorflow': False, 'pytorch': True,
'xgboost': False, 'scikit': True, 'fastai': True, 'lightgbm': False,
'hydra': True, 'detect_repository': True, 'tfdefines': True, 'joblib': True,
'megengine': True, 'catboost': True
}

Note that the tensorboard key enables/disables automatic logging for both TensorboardX and TensorBoard.

Manual Logging

To augment its automatic logging, ClearML also provides an explicit logging interface.

See more information about explicitly logging information to a ClearML Task:

Examples

Take a look at ClearML's TensorboardX examples:

  • TensorboardX with PyTorch - Demonstrates ClearML logging TensorboardX scalars, debug samples, and text in code using PyTorch
  • MegEngine MNIST - Demonstrates ClearML logging TensorboardX scalars in code using MegEngine
  • TensorboardX Video - Demonstrates ClearML logging TensorBoardX video data.