Skip to content

Commit 5a49733

Browse files
1014-mlflow-handler-tutorial (#1019)
Fixes #1014 . ### Description A tutorial about how to use mlflow handler in monai engine based training process by adding one line in code. ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [ ] Notebook runs automatically `./runner [-p <regex_pattern>]` Signed-off-by: binliu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 430cc81 commit 5a49733

File tree

4 files changed

+411
-0
lines changed

4 files changed

+411
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ This is example walks through using a Triton Server and Python client using MONA
150150
An example of experiment management with [Aim](https://aimstack.io/aim-monai-tutorial/), using 3D spleen segmentation as an example.
151151
##### [MLFlow](./experiment_management/spleen_segmentation_mlflow.ipynb)
152152
An example of experiment management with [MLFlow](https://www.mlflow.org/docs/latest/tracking.html), using 3D spleen segmentation as an example.
153+
##### [MONAI bundle integrates MLFlow](./experiment_management/bundle_integrate_mlflow.ipynb)
154+
An example shows how to easily enable and customize the MLFlow for experiment management in MONAI bundle.
153155

154156
#### <ins>**Federated Learning**</ins>
155157
##### [NVFlare](./federated_learning/nvflare)

experiment_management/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Overview
2+
This directory shows how to do experiment management in MONAI.
3+
4+
## Files
5+
1. spleen_segmentation_aim.ipynb: an example about how to deploy aim experiment management in pytorch code.
6+
2. spleen_segmentation_mlflow.ipynb: an example about how to deploy mlflow experiment management in pytorch code.
7+
3. bundle_integrate_mlflow.ipynb: an example shows how to easily enable and customize the MLFlow for experiment management in MONAI bundle.

experiment_management/bundle_integrate_mlflow.ipynb

Lines changed: 376 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"handlers_id": {
3+
"trainer": {
4+
"id": "train#trainer",
5+
"handlers": "train#handlers"
6+
}
7+
},
8+
"configs": {
9+
"tracking_uri": "$@output_dir + '/mlruns'",
10+
"experiment_name": "monai_experiment",
11+
"run_name": "test1",
12+
"is_not_rank0": "$torch.distributed.is_available() and torch.distributed.is_initialized() and torch.distributed.get_rank() > 0",
13+
"trainer": {
14+
"_target_": "MLFlowHandler",
15+
"_disabled_": "@is_not_rank0",
16+
"tracking_uri": "@tracking_uri",
17+
"experiment_name": "@experiment_name",
18+
"run_name": "@run_name",
19+
"iteration_log": true,
20+
"epoch_log": true,
21+
"tag_name": "train_loss",
22+
"output_transform": "$monai.handlers.from_engine(['loss'], first=True)",
23+
"experiment_param": "${'backbone':'unet', 'norm':'Batch'}"
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)