monai
medical
katielink commited on
Commit
47c6cd2
1 Parent(s): 31d89d2

enable deterministic training

Browse files
README.md CHANGED
@@ -15,7 +15,7 @@ The [PyTorch model](https://drive.google.com/file/d/14CS-s1uv2q6WedYQGeFbZeEWIko
15
  ## Data
16
  The datasets used in this work were provided by [Activ Surgical](https://www.activsurgical.com/).
17
 
18
- We've provided a [link](https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/inbody_outbody_samples.zip) of 20 samples (10 in-body and 10 out-body) to show what this dataset looks like.
19
 
20
  ### Preprocessing
21
  After downloading this dataset, python script in `scripts` folder named `data_process` can be used to generate label json files by running the command below and modifying `datapath` to path of unziped downloaded data. Generated label json files will be stored in `label` folder under the bundle path.
@@ -112,11 +112,7 @@ The classification result of every images in `test.json` will be printed to the
112
  #### Export checkpoint to TorchScript file:
113
 
114
  ```
115
- python -m monai.bundle ckpt_export network_def \
116
- --filepath models/model.ts \
117
- --ckpt_file models/model.pt \
118
- --meta_file configs/metadata.json \
119
- --config_file configs/inference.json
120
  ```
121
 
122
  # References
 
15
  ## Data
16
  The datasets used in this work were provided by [Activ Surgical](https://www.activsurgical.com/).
17
 
18
+ Since datasets are private, we provide a [link](https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/inbody_outbody_samples.zip) of 20 samples (10 in-body and 10 out-body) to show what they look like.
19
 
20
  ### Preprocessing
21
  After downloading this dataset, python script in `scripts` folder named `data_process` can be used to generate label json files by running the command below and modifying `datapath` to path of unziped downloaded data. Generated label json files will be stored in `label` folder under the bundle path.
 
112
  #### Export checkpoint to TorchScript file:
113
 
114
  ```
115
+ python -m monai.bundle ckpt_export network_def --filepath models/model.ts --ckpt_file models/model.pt --meta_file configs/metadata.json --config_file configs/inference.json
 
 
 
 
116
  ```
117
 
118
  # References
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.7",
4
  "changelog": {
 
5
  "0.3.7": "adapt to BundleWorkflow interface",
6
  "0.3.6": "add name tag",
7
  "0.3.5": "fix a comment issue in the data_process script",
@@ -16,7 +17,7 @@
16
  "0.1.0": "complete the first version model package",
17
  "0.0.1": "initialize the model package structure"
18
  },
19
- "monai_version": "1.2.0rc3",
20
  "pytorch_version": "1.13.1",
21
  "numpy_version": "1.22.2",
22
  "optional_packages_version": {
 
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.8",
4
  "changelog": {
5
+ "0.3.8": "enable deterministic training",
6
  "0.3.7": "adapt to BundleWorkflow interface",
7
  "0.3.6": "add name tag",
8
  "0.3.5": "fix a comment issue in the data_process script",
 
17
  "0.1.0": "complete the first version model package",
18
  "0.0.1": "initialize the model package structure"
19
  },
20
+ "monai_version": "1.2.0rc4",
21
  "pytorch_version": "1.13.1",
22
  "numpy_version": "1.22.2",
23
  "optional_packages_version": {
configs/multi_gpu_train.json CHANGED
@@ -28,8 +28,7 @@
28
  "$import torch.distributed as dist",
29
  "$dist.is_initialized() or dist.init_process_group(backend='nccl')",
30
  "$torch.cuda.set_device(@device)",
31
- "$monai.utils.set_determinism(seed=123)",
32
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
33
  ],
34
  "run": [
35
  "$@train#trainer.run()"
 
28
  "$import torch.distributed as dist",
29
  "$dist.is_initialized() or dist.init_process_group(backend='nccl')",
30
  "$torch.cuda.set_device(@device)",
31
+ "$monai.utils.set_determinism(seed=123)"
 
32
  ],
33
  "run": [
34
  "$@train#trainer.run()"
configs/train.json CHANGED
@@ -252,8 +252,7 @@
252
  }
253
  },
254
  "initialize": [
255
- "$monai.utils.set_determinism(seed=123)",
256
- "$setattr(torch.backends.cudnn, 'benchmark', True)"
257
  ],
258
  "run": [
259
  "$@train#trainer.run()"
 
252
  }
253
  },
254
  "initialize": [
255
+ "$monai.utils.set_determinism(seed=123)"
 
256
  ],
257
  "run": [
258
  "$@train#trainer.run()"
docs/README.md CHANGED
@@ -8,7 +8,7 @@ The [PyTorch model](https://drive.google.com/file/d/14CS-s1uv2q6WedYQGeFbZeEWIko
8
  ## Data
9
  The datasets used in this work were provided by [Activ Surgical](https://www.activsurgical.com/).
10
 
11
- We've provided a [link](https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/inbody_outbody_samples.zip) of 20 samples (10 in-body and 10 out-body) to show what this dataset looks like.
12
 
13
  ### Preprocessing
14
  After downloading this dataset, python script in `scripts` folder named `data_process` can be used to generate label json files by running the command below and modifying `datapath` to path of unziped downloaded data. Generated label json files will be stored in `label` folder under the bundle path.
@@ -105,11 +105,7 @@ The classification result of every images in `test.json` will be printed to the
105
  #### Export checkpoint to TorchScript file:
106
 
107
  ```
108
- python -m monai.bundle ckpt_export network_def \
109
- --filepath models/model.ts \
110
- --ckpt_file models/model.pt \
111
- --meta_file configs/metadata.json \
112
- --config_file configs/inference.json
113
  ```
114
 
115
  # References
 
8
  ## Data
9
  The datasets used in this work were provided by [Activ Surgical](https://www.activsurgical.com/).
10
 
11
+ Since datasets are private, we provide a [link](https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/inbody_outbody_samples.zip) of 20 samples (10 in-body and 10 out-body) to show what they look like.
12
 
13
  ### Preprocessing
14
  After downloading this dataset, python script in `scripts` folder named `data_process` can be used to generate label json files by running the command below and modifying `datapath` to path of unziped downloaded data. Generated label json files will be stored in `label` folder under the bundle path.
 
105
  #### Export checkpoint to TorchScript file:
106
 
107
  ```
108
+ python -m monai.bundle ckpt_export network_def --filepath models/model.ts --ckpt_file models/model.pt --meta_file configs/metadata.json --config_file configs/inference.json
 
 
 
 
109
  ```
110
 
111
  # References