Auto-logging Experiments
In ClearML, experiments are organized as Tasks.
When you integrate the ClearML SDK with your code, the ClearML task manager automatically captures:
- Source code and uncommitted changes
- Installed packages
- General information such as machine details, runtime, creation date etc.
- Model files, parameters, scalars, and plots from popular ML frameworks such as TensorFlow and PyTorch (see list of supported frameworks)
- Console output
To control what ClearML automatically logs, see this FAQ.
To Auto-log Your Experiments
-
Install
clearmland connect it to the ClearML Server (see instructions) -
At the beginning of your code, import the
clearmlpackage:from clearml import TaskFull Automatic LoggingTo ensure full automatic logging, it is recommended to import the
clearmlpackage at the top of your entry script. Initializing the Task before training frameworks (e.g. TensorFlow, PyTorch) start executing prevents synchronization issues that can lead to memory leaks or hanging child processes. -
Initialize the Task object in your
main()function, or the beginning of the script.task = Task.init(project_name='great project', task_name='best task')If the project does not already exist, a new one is created automatically.
The console should display the following output:
ClearML Task: created new task id=1ca59ef1f86d44bd81cb517d529d9e5a2021-07-25 13:59:09ClearML results page: https://app.clear.ml/projects/4043a1657f374e9298649c6ba72ad233/experiments/1ca59ef1f86d44bd81cb517d529d9e5a/output/log2025-01-25 13:59:16 -
Click the results page link to go to the task's detail page in the ClearML WebApp, where you can monitor the task's status, view all its logged data, visualize its results, and more!

That's it! You are done integrating ClearML with your code :)
Now, command-line arguments, console output, TensorBoard and Matplotlib, and much more will automatically be logged in the UI under the created Task.
Sit back, relax, and watch your models converge :)