clearml-docs/docs/guides/frameworks/megengine/megengine_mnist.md
2021-12-27 10:41:43 +02:00

55 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: MegEngine
---
The [megengine_mnist.py](https://github.com/allegroai/clearml/blob/master/examples/frameworks/megengine/megengine_mnist.py)
example demonstrates the integration of ClearML into code that uses [MegEngine](https://github.com/MegEngine/MegEngine)
and [TensorBoardX](https://github.com/lanpa/tensorboardX). ClearML automatically captures models saved with `megengine`.
The example script does the following:
* Trains a simple deep neural network on MegEngine's built-in [MNIST](https://megengine.org.cn/doc/stable/en/reference/api/megengine.data.dataset.MNIST.html)
dataset.
* Creates a TensorBoardX `SummaryWriter` object to log scalars during training.
* Creates a ClearML experiment named `megengine mnist train`, which is associated with the `examples` project.
## Hyperparameters
ClearML automatically logs command line options defined with `argparse`. They appear in the experiment's **CONFIGURATIONS**
page under **HYPER PARAMETERS** **>** **Args**.
![Configuration tab](../../../img/examples_megengine_mnist_config.png)
## Scalars
The example script's `train` function calls TensorBoardX's `SummaryWriter.add_scalar` method to report `loss`.
ClearML automatically captures the data that is added to the `SummaryWriter` object.
These scalars can be visualized in plots, which appear in the ClearML [WebApp](../../../webapp/webapp_home.md), in the
experiment's **RESULTS** **>** **SCALARS** page.
![Scalars tab](../../../img/examples_megengine_mnist_scalars.png)
## Models
ClearML automatically captures the model logged using the `megengine.save` method, and saves it as an artifact.
View saved snapshots in the experiment's **ARTIFACTS** tab.
![Artifacts tab](../../../img/examples_megengine_models_1.png)
To view the model details, click the model name in the **ARTIFACTS** page, which will open the model's info tab. Alternatively, download the model.
The model info panel contains the model details, including:
* Model URL
* Framework
* Snapshot locations.
![Model info panel](../../../img/examples_megengine_models_2.png)
## Console
All console output during the scripts execution appears in the experiments **RESULTS > CONSOLE** page.
![Console tab](../../../img/examples_megengine_console.png)