katielink commited on
Commit
d56249f
1 Parent(s): e54516b

adapt to BundleWorkflow interface

Browse files
README.md CHANGED
@@ -74,17 +74,17 @@ For more details usage instructions, visit the [MONAI Bundle Configuration Page]
74
 
75
  #### Execute training:
76
  ```
77
- python -m monai.bundle run training --meta_file configs/metadata.json --config_file configs/train.json --logging_file configs/logging.conf
78
  ```
79
 
80
  #### Override the `train` config to execute evaluation with the trained model:
81
  ```
82
- python -m monai.bundle run evaluating --meta_file configs/metadata.json --config_file "['configs/train.json','configs/evaluate.json']" --logging_file configs/logging.conf
83
  ```
84
 
85
  #### Execute inference on resampled LUNA16 images by setting `"whether_raw_luna16": false` in `inference.json`:
86
  ```
87
- python -m monai.bundle run evaluating --meta_file configs/metadata.json --config_file configs/inference.json --logging_file configs/logging.conf
88
  ```
89
  With the same command, we can execute inference on original LUNA16 images by setting `"whether_raw_luna16": true` in `inference.json`. Remember to also set `"data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/mhd_original/dataset_fold0.json'"` and change `"dataset_dir"`.
90
 
 
74
 
75
  #### Execute training:
76
  ```
77
+ python -m monai.bundle run --config_file configs/train.json
78
  ```
79
 
80
  #### Override the `train` config to execute evaluation with the trained model:
81
  ```
82
+ python -m monai.bundle run --config_file "['configs/train.json','configs/evaluate.json']"
83
  ```
84
 
85
  #### Execute inference on resampled LUNA16 images by setting `"whether_raw_luna16": false` in `inference.json`:
86
  ```
87
+ python -m monai.bundle run --config_file configs/inference.json
88
  ```
89
  With the same command, we can execute inference on original LUNA16 images by setting `"whether_raw_luna16": true` in `inference.json`. Remember to also set `"data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/mhd_original/dataset_fold0.json'"` and change `"dataset_dir"`.
90
 
configs/evaluate.json CHANGED
@@ -41,8 +41,10 @@
41
  "summary_ops": "*"
42
  }
43
  ],
44
- "evaluating": [
45
- "$setattr(torch.backends.cudnn, 'benchmark', True)",
 
 
46
  "$@validate#evaluator.run()"
47
  ]
48
  }
 
41
  "summary_ops": "*"
42
  }
43
  ],
44
+ "initialize": [
45
+ "$setattr(torch.backends.cudnn, 'benchmark', True)"
46
+ ],
47
+ "run": [
48
  "$@validate#evaluator.run()"
49
  ]
50
  }
configs/inference.json CHANGED
@@ -5,7 +5,7 @@
5
  "$import glob",
6
  "$import os"
7
  ],
8
- "bundle_root": "./",
9
  "ckpt_dir": "$@bundle_root + '/models'",
10
  "output_dir": "$@bundle_root + '/eval'",
11
  "data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/dataset_fold0.json'",
@@ -202,8 +202,10 @@
202
  "val_handlers": "@handlers",
203
  "amp": "@amp"
204
  },
205
- "evaluating": [
206
- "$setattr(torch.backends.cudnn, 'benchmark', True)",
 
 
207
208
  ]
209
  }
 
5
  "$import glob",
6
  "$import os"
7
  ],
8
+ "bundle_root": ".",
9
  "ckpt_dir": "$@bundle_root + '/models'",
10
  "output_dir": "$@bundle_root + '/eval'",
11
  "data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/dataset_fold0.json'",
 
202
  "val_handlers": "@handlers",
203
  "amp": "@amp"
204
  },
205
+ "initialize": [
206
+ "$setattr(torch.backends.cudnn, 'benchmark', True)"
207
+ ],
208
+ "run": [
209
210
  ]
211
  }
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.5.2",
4
  "changelog": {
 
5
  "0.5.2": "black autofix format and add name tag",
6
  "0.5.1": "modify dataset key name",
7
  "0.5.0": "use detection inferer",
@@ -16,13 +17,13 @@
16
  "0.1.1": "add reference for LIDC dataset",
17
  "0.1.0": "complete the model package"
18
  },
19
- "monai_version": "1.0.1",
20
- "pytorch_version": "1.13.0",
21
- "numpy_version": "1.22.4",
22
  "optional_packages_version": {
23
  "nibabel": "4.0.1",
24
  "pytorch-ignite": "0.4.9",
25
- "torchvision": "0.14.0"
26
  },
27
  "name": "Lung nodule CT detection",
28
  "task": "CT lung nodule detection",
 
1
  {
2
  "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json",
3
+ "version": "0.5.3",
4
  "changelog": {
5
+ "0.5.3": "adapt to BundleWorkflow interface",
6
  "0.5.2": "black autofix format and add name tag",
7
  "0.5.1": "modify dataset key name",
8
  "0.5.0": "use detection inferer",
 
17
  "0.1.1": "add reference for LIDC dataset",
18
  "0.1.0": "complete the model package"
19
  },
20
+ "monai_version": "1.2.0rc3",
21
+ "pytorch_version": "1.13.1",
22
+ "numpy_version": "1.22.2",
23
  "optional_packages_version": {
24
  "nibabel": "4.0.1",
25
  "pytorch-ignite": "0.4.9",
26
+ "torchvision": "0.14.1"
27
  },
28
  "name": "Lung nodule CT detection",
29
  "task": "CT lung nodule detection",
configs/train.json CHANGED
@@ -3,7 +3,7 @@
3
  "$import glob",
4
  "$import os"
5
  ],
6
- "bundle_root": "./",
7
  "ckpt_dir": "$@bundle_root + '/models'",
8
  "output_dir": "$@bundle_root + '/eval'",
9
  "data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/dataset_fold0.json'",
@@ -446,10 +446,12 @@
446
  "amp": "@amp"
447
  }
448
  },
449
- "training": [
450
  "os.environ['CUDA_LAUNCH_BLOCKING']=1",
451
  "$monai.utils.set_determinism(seed=123)",
452
- "$setattr(torch.backends.cudnn, 'benchmark', True)",
 
 
453
  "$@train#trainer.run()"
454
  ]
455
  }
 
3
  "$import glob",
4
  "$import os"
5
  ],
6
+ "bundle_root": ".",
7
  "ckpt_dir": "$@bundle_root + '/models'",
8
  "output_dir": "$@bundle_root + '/eval'",
9
  "data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/dataset_fold0.json'",
 
446
  "amp": "@amp"
447
  }
448
  },
449
+ "initialize": [
450
  "os.environ['CUDA_LAUNCH_BLOCKING']=1",
451
  "$monai.utils.set_determinism(seed=123)",
452
+ "$setattr(torch.backends.cudnn, 'benchmark', True)"
453
+ ],
454
+ "run": [
455
  "$@train#trainer.run()"
456
  ]
457
  }
docs/README.md CHANGED
@@ -67,17 +67,17 @@ For more details usage instructions, visit the [MONAI Bundle Configuration Page]
67
 
68
  #### Execute training:
69
  ```
70
- python -m monai.bundle run training --meta_file configs/metadata.json --config_file configs/train.json --logging_file configs/logging.conf
71
  ```
72
 
73
  #### Override the `train` config to execute evaluation with the trained model:
74
  ```
75
- python -m monai.bundle run evaluating --meta_file configs/metadata.json --config_file "['configs/train.json','configs/evaluate.json']" --logging_file configs/logging.conf
76
  ```
77
 
78
  #### Execute inference on resampled LUNA16 images by setting `"whether_raw_luna16": false` in `inference.json`:
79
  ```
80
- python -m monai.bundle run evaluating --meta_file configs/metadata.json --config_file configs/inference.json --logging_file configs/logging.conf
81
  ```
82
  With the same command, we can execute inference on original LUNA16 images by setting `"whether_raw_luna16": true` in `inference.json`. Remember to also set `"data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/mhd_original/dataset_fold0.json'"` and change `"dataset_dir"`.
83
 
 
67
 
68
  #### Execute training:
69
  ```
70
+ python -m monai.bundle run --config_file configs/train.json
71
  ```
72
 
73
  #### Override the `train` config to execute evaluation with the trained model:
74
  ```
75
+ python -m monai.bundle run --config_file "['configs/train.json','configs/evaluate.json']"
76
  ```
77
 
78
  #### Execute inference on resampled LUNA16 images by setting `"whether_raw_luna16": false` in `inference.json`:
79
  ```
80
+ python -m monai.bundle run --config_file configs/inference.json
81
  ```
82
  With the same command, we can execute inference on original LUNA16 images by setting `"whether_raw_luna16": true` in `inference.json`. Remember to also set `"data_list_file_path": "$@bundle_root + '/LUNA16_datasplit/mhd_original/dataset_fold0.json'"` and change `"dataset_dir"`.
83