clearml-docs/docs/guides/frameworks/tensorboardx/tensorboardx.md

51 lines
2.3 KiB
Markdown
Raw Normal View History

2021-05-13 23:48:51 +00:00
---
title: TensorBoardX with PyTorch
2021-05-13 23:48:51 +00:00
---
2025-02-13 08:48:26 +00:00
The [pytorch_tensorboardX.py](https://github.com/clearml/clearml/blob/master/examples/frameworks/tensorboardx/pytorch_tensorboardX.py)
2022-01-13 07:42:36 +00:00
example demonstrates the integration of ClearML into code that uses PyTorch and TensorBoardX.
2021-05-13 23:48:51 +00:00
The script does the following:
2022-01-16 09:13:53 +00:00
* Trains a simple deep neural network on the PyTorch built-in [MNIST](https://pytorch.org/vision/stable/datasets.html#mnist) dataset
2025-02-06 15:31:11 +00:00
* Creates a task named `pytorch with tensorboardX` in the `examples` project
2022-01-13 07:42:36 +00:00
* ClearML automatically captures scalars and text logged using the TensorBoardX `SummaryWriter` object, and
2022-01-16 09:13:53 +00:00
the model created by PyTorch
2021-05-13 23:48:51 +00:00
## Scalars
2025-02-06 15:31:11 +00:00
The loss and accuracy metric scalar plots appear in the task's page in the **ClearML web UI**, under
2022-05-22 07:27:30 +00:00
**SCALARS**. The also includes resource utilization plots, which are titled **:monitor: machine**.
2021-05-13 23:48:51 +00:00
![Scalars](../../../img/examples_pytorch_tensorboardx_03.png#light-mode-only)
![Scalars](../../../img/examples_pytorch_tensorboardx_03_dark.png#dark-mode-only)
2021-05-13 23:48:51 +00:00
## Hyperparameters
2022-05-26 06:54:41 +00:00
ClearML automatically logs command line options defined with `argparse`. They appear in **CONFIGURATION** **>**
2023-01-12 10:49:55 +00:00
**HYPERPARAMETERS** **>** **Args**.
2021-05-13 23:48:51 +00:00
![Hyperparameters](../../../img/examples_pytorch_tensorboardx_01.png#light-mode-only)
![Hyperparameters](../../../img/examples_pytorch_tensorboardx_01_dark.png#dark-mode-only)
2021-05-13 23:48:51 +00:00
2021-05-18 22:31:01 +00:00
## Console
2021-05-13 23:48:51 +00:00
2022-05-22 07:27:30 +00:00
Text printed to the console for training progress, as well as all other console output, appear in **CONSOLE**.
2021-05-13 23:48:51 +00:00
![Console log](../../../img/examples_pytorch_tensorboardx_02.png#light-mode-only)
![Console log](../../../img/examples_pytorch_tensorboardx_02_dark.png#dark-mode-only)
2021-05-13 23:48:51 +00:00
## Artifacts
2025-02-06 15:31:11 +00:00
Models created by the task appear in the task's **ARTIFACTS** tab. ClearML automatically logs and tracks
2022-01-13 07:42:36 +00:00
models and any snapshots created using PyTorch.
2021-05-13 23:48:51 +00:00
![Artifacts](../../../img/examples_pytorch_tensorboardx_04.png#light-mode-only)
![Artifacts](../../../img/examples_pytorch_tensorboardx_04_dark.png#dark-mode-only)
2021-05-13 23:48:51 +00:00
2023-10-01 07:31:48 +00:00
Clicking on the model's name takes you to the [model's page](../../../webapp/webapp_model_viewing.md), where you can
view the model's details and access the model.
2021-05-13 23:48:51 +00:00
![Model details](../../../img/examples_pytorch_tensorboardx_model.png#light-mode-only)
![Model details](../../../img/examples_pytorch_tensorboardx_model_dark.png#dark-mode-only)
2021-05-13 23:48:51 +00:00