Update docs (#520)

This commit is contained in:
pollfly 2023-04-03 10:27:43 +03:00 committed by GitHub
parent 73d4561766
commit 97aa1e7bad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 3 deletions

View File

@ -101,7 +101,8 @@ input_model = InputModel.import_model(
task.connect(input_model)
```
## Querying Models
## Accessing Models
### Querying Models
Retrieve a list of model objects by querying the system by model names, projects, tags, and more, using the
[`Model.query_models`](../references/sdk/model_model.md#modelquery_models) and / or
the [`InputModel.query_models`](../references/sdk/model_inputmodel.md#inputmodelquery_models) class methods. These
@ -127,7 +128,7 @@ model_list = Model.query_models(
)
```
### Tag Filters
#### Tag Filters
The `tags` field supports advanced queries through combining tag names and operators into a list.
The supported operators are:
@ -177,6 +178,31 @@ The default operator for a query is `or`, unless `and` is placed at the beginnin
)
```
### Retrieving Models
Retrieve a local copy of a ClearML model through a `Model`/`InputModel` object's [`get_local_copy()`](../references/sdk/model_outputmodel.md#get_local_copy).
The method returns a path to a cached local copy of the model. In the case that the model is already cached, you can set
`force_download` to `True` in order to download a fresh version.
## Logging Metrics and Plots
Use the following methods to explicitly log additional information to your models.
These methods can be used on `Model`, `InputModel`, and/or `OutputModel` objects:
* Scalars
* Scalar series plots - [`report_scalar`](../references/sdk/model_outputmodel.md#report_scalar)
* Single metric values - [`report_single_value`](../references/sdk/model_outputmodel.md#report_single_value)
* Plots
* 2d plots
* Histogram - [`report_histogram`](../references/sdk/model_outputmodel.md#report_historgram)
* Vector as histogram plot - [`report_vector`](../references/sdk/model_outputmodel.md#report_vector)
* Table - [`report_table`](../references/sdk/model_outputmodel.md#report_table)
* Line plot - [`report_line_plot`](../references/sdk/model_outputmodel.md#report_line_plot)
* Scatter plot - [`report_scatter2d`](../references/sdk/model_outputmodel.md#report_scatter2d)
* Confusion matrix (heat map) - [`report_confusion_matrix`](../references/sdk/model_outputmodel.md#report_confusion_matrix) & [`report_matrix`](../references/sdk/model_outputmodel.md#report_matrix)
* 3d plots
* Scatter plot - [`report_scatter3d`](../references/sdk/model_outputmodel.md#report_scatter3d)
* Surface plot - [`report_surface`](../references/sdk/model_outputmodel.md#report_surface)
## SDK Reference
For information about all model methods, see the following SDK reference pages:

View File

@ -409,6 +409,11 @@ folder, which can later be uploaded to the [ClearML Server](../deploying_clearml
Before initializing a Task, use the [Task.set_offline](../references/sdk/task.md#taskset_offline) class method and set
the `offline_mode` argument to `True`. The method returns the Task ID and a path to the session folder.
:::caution
Notice that the `Task.set_offline` method only works with tasks created using `Task.init` and not with those created
using the `Task.create` method.
:::
```python
from clearml import Task
# Use the set_offline class method before initializing a Task
@ -435,6 +440,17 @@ Upload the execution data that the Task captured offline to the ClearML Server u
```
In the `session_folder_zip` argument, insert the path to the zip folder containing the session.
To upload the session from the same script that created it, first close the task then disable offline mode:
```python
Task.set_offline(offline_mode=True)
task = Task.init(project_name="examples", task_name="my_task")
# task code
task.close()
Task.set_offline(False)
Task.import_offline_session(task.get_offline_mode_folder())
```
You can also use the offline task to update the execution of an existing previously executed task by providing the
previously executed tasks ID. To avoid overwriting metrics, you can specify the initial iteration offset with

View File

@ -11,6 +11,12 @@ local folder, which can be later uploaded to the [ClearML Server](../deploying_c
Before initializing a Task, use the [Task.set_offline](../references/sdk/task.md#taskset_offline) class method and set the
`offline_mode` argument to `True`.
:::caution
Notice that the `Task.set_offline` method only works with tasks created using `Task.init` and not with those created
using the `Task.create` method.
:::
```python
from clearml import Task
# Use the set_offline class method before initializing a Task
@ -57,7 +63,18 @@ Upload the session's execution data that the Task captured offline to the ClearM
```
In the `session_folder_zip` argument, insert the path to the zip folder containing the session.
To upload the session from the same script that created it, first close the task then disable offline mode:
```python
Task.set_offline(offline_mode=True)
task = Task.init(project_name="examples", task_name="my_task")
# task code
task.close()
Task.set_offline(False)
Task.import_offline_session(task.get_offline_mode_folder())
```
You can also use the offline task to update the execution of an existing previously executed task by providing the
previously executed tasks ID. To avoid overwriting metrics, you can specify the initial iteration offset with
`iteration_offset`.