re-train model with updated dints implementation
Browse files- README.md +8 -8
- configs/evaluate.yaml +2 -1
- configs/inference.yaml +3 -2
- configs/metadata.json +5 -4
- configs/multi_gpu_train.yaml +5 -3
- configs/train.yaml +3 -3
- docs/README.md +8 -8
- models/model.pt +2 -2
- models/model.ts +2 -2
- models/search_code_18590.pt +1 -1
README.md
CHANGED
@@ -66,17 +66,17 @@ Dice score is used for evaluating the performance of the model. This model achie
|
|
66 |
#### Training Loss
|
67 |
The loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
68 |
|
69 |
-
![Training loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_train_4-
|
70 |
|
71 |
#### Validation Dice
|
72 |
The mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
73 |
|
74 |
-
![Validation mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_validation_4-
|
75 |
|
76 |
### Searched Architecture Visualization
|
77 |
-
Users can install Graphviz for visualization of searched architectures (needed in
|
78 |
|
79 |
-
![Example of Searched Architecture](https://developer.download.nvidia.com/assets/Clara/Images/
|
80 |
|
81 |
## MONAI Bundle Commands
|
82 |
In addition to the Pythonic APIs, a few command line interfaces (CLI) are provided to interact with the bundle. The CLI supports flexible use cases, such as overriding configs at runtime and predefining arguments in a file.
|
@@ -98,25 +98,25 @@ torchrun --nnodes=1 --nproc_per_node=8 -m scripts.search run --config_file confi
|
|
98 |
#### Execute training:
|
99 |
|
100 |
```
|
101 |
-
python -m monai.bundle run
|
102 |
```
|
103 |
|
104 |
#### Override the `train` config to execute multi-GPU training:
|
105 |
|
106 |
```
|
107 |
-
torchrun --nnodes=1 --nproc_per_node=
|
108 |
```
|
109 |
|
110 |
#### Override the `train` config to execute evaluation with the trained model:
|
111 |
|
112 |
```
|
113 |
-
python -m monai.bundle run
|
114 |
```
|
115 |
|
116 |
#### Execute inference:
|
117 |
|
118 |
```
|
119 |
-
python -m monai.bundle run
|
120 |
```
|
121 |
|
122 |
#### Export checkpoint for TorchScript
|
|
|
66 |
#### Training Loss
|
67 |
The loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
68 |
|
69 |
+
![Training loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_train_4-3.png)
|
70 |
|
71 |
#### Validation Dice
|
72 |
The mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
73 |
|
74 |
+
![Validation mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_validation_4-3.png)
|
75 |
|
76 |
### Searched Architecture Visualization
|
77 |
+
Users can install Graphviz for visualization of searched architectures (needed in [decode_plot.py](https://github.com/Project-MONAI/tutorials/blob/main/automl/DiNTS/decode_plot.py)). The edges between nodes indicate global structure, and numbers next to edges represent different operations in the cell searching space. An example of searched architecture is shown as follows:
|
78 |
|
79 |
+
![Example of Searched Architecture](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_searched_arch_example_1.png)
|
80 |
|
81 |
## MONAI Bundle Commands
|
82 |
In addition to the Pythonic APIs, a few command line interfaces (CLI) are provided to interact with the bundle. The CLI supports flexible use cases, such as overriding configs at runtime and predefining arguments in a file.
|
|
|
98 |
#### Execute training:
|
99 |
|
100 |
```
|
101 |
+
python -m monai.bundle run --config_file configs/train.yaml
|
102 |
```
|
103 |
|
104 |
#### Override the `train` config to execute multi-GPU training:
|
105 |
|
106 |
```
|
107 |
+
torchrun --nnodes=1 --nproc_per_node=8 -m monai.bundle run --config_file "['configs/train.yaml','configs/multi_gpu_train.yaml']"
|
108 |
```
|
109 |
|
110 |
#### Override the `train` config to execute evaluation with the trained model:
|
111 |
|
112 |
```
|
113 |
+
python -m monai.bundle run --config_file "['configs/train.yaml','configs/evaluate.yaml']"
|
114 |
```
|
115 |
|
116 |
#### Execute inference:
|
117 |
|
118 |
```
|
119 |
+
python -m monai.bundle run --config_file configs/inference.yaml
|
120 |
```
|
121 |
|
122 |
#### Export checkpoint for TorchScript
|
configs/evaluate.yaml
CHANGED
@@ -59,6 +59,7 @@ validate#handlers:
|
|
59 |
- val_mean_dice
|
60 |
batch_transform: "$monai.handlers.from_engine(['image_meta_dict'])"
|
61 |
summary_ops: "*"
|
62 |
-
|
63 |
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
|
|
|
64 |
- "$@validate#evaluator.run()"
|
|
|
59 |
- val_mean_dice
|
60 |
batch_transform: "$monai.handlers.from_engine(['image_meta_dict'])"
|
61 |
summary_ops: "*"
|
62 |
+
initialize:
|
63 |
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
|
64 |
+
run:
|
65 |
- "$@validate#evaluator.run()"
|
configs/inference.yaml
CHANGED
@@ -6,7 +6,7 @@ input_channels: 1
|
|
6 |
output_classes: 3
|
7 |
arch_ckpt_path: "$@bundle_root + '/models/search_code_18590.pt'"
|
8 |
arch_ckpt: "$torch.load(@arch_ckpt_path, map_location=torch.device('cuda'))"
|
9 |
-
bundle_root: "
|
10 |
output_dir: "$@bundle_root + '/eval'"
|
11 |
dataset_dir: "/workspace/data/msd/Task07_Pancreas"
|
12 |
data_list_file_path: "$@bundle_root + '/configs/dataset_0.json'"
|
@@ -111,6 +111,7 @@ evaluator:
|
|
111 |
postprocessing: "@postprocessing"
|
112 |
val_handlers: "@handlers"
|
113 |
amp: true
|
114 |
-
|
115 |
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
|
|
|
116 |
- "$@evaluator.run()"
|
|
|
6 |
output_classes: 3
|
7 |
arch_ckpt_path: "$@bundle_root + '/models/search_code_18590.pt'"
|
8 |
arch_ckpt: "$torch.load(@arch_ckpt_path, map_location=torch.device('cuda'))"
|
9 |
+
bundle_root: "."
|
10 |
output_dir: "$@bundle_root + '/eval'"
|
11 |
dataset_dir: "/workspace/data/msd/Task07_Pancreas"
|
12 |
data_list_file_path: "$@bundle_root + '/configs/dataset_0.json'"
|
|
|
111 |
postprocessing: "@postprocessing"
|
112 |
val_handlers: "@handlers"
|
113 |
amp: true
|
114 |
+
initialize:
|
115 |
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
|
116 |
+
run:
|
117 |
- "$@evaluator.run()"
|
configs/metadata.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
{
|
2 |
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json",
|
3 |
-
"version": "0.3.
|
4 |
"changelog": {
|
|
|
5 |
"0.3.6": "black autofix format and add name tag",
|
6 |
"0.3.5": "restructure readme to match updated template",
|
7 |
"0.3.4": "correct typos",
|
@@ -14,9 +15,9 @@
|
|
14 |
"0.1.0": "complete the model package",
|
15 |
"0.0.1": "initialize the model package structure"
|
16 |
},
|
17 |
-
"monai_version": "1.
|
18 |
-
"pytorch_version": "1.13.
|
19 |
-
"numpy_version": "1.
|
20 |
"optional_packages_version": {
|
21 |
"fire": "0.4.0",
|
22 |
"nibabel": "4.0.1",
|
|
|
1 |
{
|
2 |
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json",
|
3 |
+
"version": "0.3.7",
|
4 |
"changelog": {
|
5 |
+
"0.3.7": "re-train model with updated dints implementation",
|
6 |
"0.3.6": "black autofix format and add name tag",
|
7 |
"0.3.5": "restructure readme to match updated template",
|
8 |
"0.3.4": "correct typos",
|
|
|
15 |
"0.1.0": "complete the model package",
|
16 |
"0.0.1": "initialize the model package structure"
|
17 |
},
|
18 |
+
"monai_version": "1.2.0rc4",
|
19 |
+
"pytorch_version": "1.13.1",
|
20 |
+
"numpy_version": "1.22.2",
|
21 |
"optional_packages_version": {
|
22 |
"fire": "0.4.0",
|
23 |
"nibabel": "4.0.1",
|
configs/multi_gpu_train.yaml
CHANGED
@@ -26,14 +26,16 @@ train#handlers:
|
|
26 |
train#trainer#max_epochs: "$400*dist.get_world_size()"
|
27 |
train#trainer#train_handlers: "$@train#handlers[: -2 if dist.get_rank() > 0 else None]"
|
28 |
validate#evaluator#val_handlers: "$None if dist.get_rank() > 0 else @validate#handlers"
|
29 |
-
|
30 |
- "$import torch.distributed as dist"
|
31 |
-
- "$dist.init_process_group(backend='nccl')"
|
32 |
- "$torch.cuda.set_device(@device)"
|
33 |
- "$monai.utils.set_determinism(seed=123)"
|
34 |
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
|
|
|
35 |
- "$@train#trainer.run()"
|
36 |
-
|
|
|
37 |
train_data_partition: "$monai.data.partition_dataset(data=@train_datalist, num_partitions=dist.get_world_size(),
|
38 |
shuffle=True, even_divisible=True,)[dist.get_rank()]"
|
39 |
train#dataset:
|
|
|
26 |
train#trainer#max_epochs: "$400*dist.get_world_size()"
|
27 |
train#trainer#train_handlers: "$@train#handlers[: -2 if dist.get_rank() > 0 else None]"
|
28 |
validate#evaluator#val_handlers: "$None if dist.get_rank() > 0 else @validate#handlers"
|
29 |
+
initialize:
|
30 |
- "$import torch.distributed as dist"
|
31 |
+
- "$dist.is_initialized() or dist.init_process_group(backend='nccl')"
|
32 |
- "$torch.cuda.set_device(@device)"
|
33 |
- "$monai.utils.set_determinism(seed=123)"
|
34 |
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
|
35 |
+
run:
|
36 |
- "$@train#trainer.run()"
|
37 |
+
finalize:
|
38 |
+
- "$dist.is_initialized() and dist.destroy_process_group()"
|
39 |
train_data_partition: "$monai.data.partition_dataset(data=@train_datalist, num_partitions=dist.get_world_size(),
|
40 |
shuffle=True, even_divisible=True,)[dist.get_rank()]"
|
41 |
train#dataset:
|
configs/train.yaml
CHANGED
@@ -9,7 +9,7 @@ input_channels: 1
|
|
9 |
output_classes: 3
|
10 |
arch_ckpt_path: "$@bundle_root + '/models/search_code_18590.pt'"
|
11 |
arch_ckpt: "$torch.load(@arch_ckpt_path, map_location=torch.device('cuda'))"
|
12 |
-
bundle_root: "
|
13 |
ckpt_dir: "$@bundle_root + '/models'"
|
14 |
output_dir: "$@bundle_root + '/eval'"
|
15 |
dataset_dir: "/workspace/data/msd/Task07_Pancreas"
|
@@ -348,7 +348,7 @@ validate:
|
|
348 |
additional_metrics: "@validate#additional_metrics"
|
349 |
val_handlers: "@validate#handlers"
|
350 |
amp: true
|
351 |
-
|
352 |
- "$monai.utils.set_determinism(seed=123)"
|
353 |
-
|
354 |
- "$@train#trainer.run()"
|
|
|
9 |
output_classes: 3
|
10 |
arch_ckpt_path: "$@bundle_root + '/models/search_code_18590.pt'"
|
11 |
arch_ckpt: "$torch.load(@arch_ckpt_path, map_location=torch.device('cuda'))"
|
12 |
+
bundle_root: "."
|
13 |
ckpt_dir: "$@bundle_root + '/models'"
|
14 |
output_dir: "$@bundle_root + '/eval'"
|
15 |
dataset_dir: "/workspace/data/msd/Task07_Pancreas"
|
|
|
348 |
additional_metrics: "@validate#additional_metrics"
|
349 |
val_handlers: "@validate#handlers"
|
350 |
amp: true
|
351 |
+
initialize:
|
352 |
- "$monai.utils.set_determinism(seed=123)"
|
353 |
+
run:
|
354 |
- "$@train#trainer.run()"
|
docs/README.md
CHANGED
@@ -59,17 +59,17 @@ Dice score is used for evaluating the performance of the model. This model achie
|
|
59 |
#### Training Loss
|
60 |
The loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
61 |
|
62 |
-
![Training loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_train_4-
|
63 |
|
64 |
#### Validation Dice
|
65 |
The mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
66 |
|
67 |
-
![Validation mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_validation_4-
|
68 |
|
69 |
### Searched Architecture Visualization
|
70 |
-
Users can install Graphviz for visualization of searched architectures (needed in
|
71 |
|
72 |
-
![Example of Searched Architecture](https://developer.download.nvidia.com/assets/Clara/Images/
|
73 |
|
74 |
## MONAI Bundle Commands
|
75 |
In addition to the Pythonic APIs, a few command line interfaces (CLI) are provided to interact with the bundle. The CLI supports flexible use cases, such as overriding configs at runtime and predefining arguments in a file.
|
@@ -91,25 +91,25 @@ torchrun --nnodes=1 --nproc_per_node=8 -m scripts.search run --config_file confi
|
|
91 |
#### Execute training:
|
92 |
|
93 |
```
|
94 |
-
python -m monai.bundle run
|
95 |
```
|
96 |
|
97 |
#### Override the `train` config to execute multi-GPU training:
|
98 |
|
99 |
```
|
100 |
-
torchrun --nnodes=1 --nproc_per_node=
|
101 |
```
|
102 |
|
103 |
#### Override the `train` config to execute evaluation with the trained model:
|
104 |
|
105 |
```
|
106 |
-
python -m monai.bundle run
|
107 |
```
|
108 |
|
109 |
#### Execute inference:
|
110 |
|
111 |
```
|
112 |
-
python -m monai.bundle run
|
113 |
```
|
114 |
|
115 |
#### Export checkpoint for TorchScript
|
|
|
59 |
#### Training Loss
|
60 |
The loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
61 |
|
62 |
+
![Training loss over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_train_4-3.png)
|
63 |
|
64 |
#### Validation Dice
|
65 |
The mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)
|
66 |
|
67 |
+
![Validation mean dice score over 3200 epochs (the bright curve is smoothed, and the dark one is the actual curve)](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_validation_4-3.png)
|
68 |
|
69 |
### Searched Architecture Visualization
|
70 |
+
Users can install Graphviz for visualization of searched architectures (needed in [decode_plot.py](https://github.com/Project-MONAI/tutorials/blob/main/automl/DiNTS/decode_plot.py)). The edges between nodes indicate global structure, and numbers next to edges represent different operations in the cell searching space. An example of searched architecture is shown as follows:
|
71 |
|
72 |
+
![Example of Searched Architecture](https://developer.download.nvidia.com/assets/Clara/Images/clara_pt_net_arch_search_segmentation_searched_arch_example_1.png)
|
73 |
|
74 |
## MONAI Bundle Commands
|
75 |
In addition to the Pythonic APIs, a few command line interfaces (CLI) are provided to interact with the bundle. The CLI supports flexible use cases, such as overriding configs at runtime and predefining arguments in a file.
|
|
|
91 |
#### Execute training:
|
92 |
|
93 |
```
|
94 |
+
python -m monai.bundle run --config_file configs/train.yaml
|
95 |
```
|
96 |
|
97 |
#### Override the `train` config to execute multi-GPU training:
|
98 |
|
99 |
```
|
100 |
+
torchrun --nnodes=1 --nproc_per_node=8 -m monai.bundle run --config_file "['configs/train.yaml','configs/multi_gpu_train.yaml']"
|
101 |
```
|
102 |
|
103 |
#### Override the `train` config to execute evaluation with the trained model:
|
104 |
|
105 |
```
|
106 |
+
python -m monai.bundle run --config_file "['configs/train.yaml','configs/evaluate.yaml']"
|
107 |
```
|
108 |
|
109 |
#### Execute inference:
|
110 |
|
111 |
```
|
112 |
+
python -m monai.bundle run --config_file configs/inference.yaml
|
113 |
```
|
114 |
|
115 |
#### Export checkpoint for TorchScript
|
models/model.pt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a18ae8b837f6affe778d7e9f130e6045c04a6f7d5b5dd8470155b9a18b6bcb65
|
3 |
+
size 553830837
|
models/model.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39d6087354fcff7b90e27191e5654774b98e6d7b503aa5752edfa9b07867bd5a
|
3 |
+
size 554038651
|
models/search_code_18590.pt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 4355
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5049f457b4cdbee036faf56ff5445c633300128d582731e6364c97fa3dc8a515
|
3 |
size 4355
|