|
144 | 144 | },
|
145 | 145 | {
|
146 | 146 | "cell_type": "code",
|
147 |
| - "execution_count": 7, |
| 147 | + "execution_count": 4, |
148 | 148 | "metadata": {},
|
149 | 149 | "outputs": [
|
150 | 150 | {
|
|
159 | 159 | "url None\n",
|
160 | 160 | "remove_prefix monai_\n",
|
161 | 161 | "progress True\n",
|
162 |
| - "2023-09-06 08:44:11,165 - INFO - --- input summary of monai.bundle.scripts.download ---\n", |
163 |
| - "2023-09-06 08:44:11,167 - INFO - > name: 'spleen_ct_segmentation'\n", |
164 |
| - "2023-09-06 08:44:11,167 - INFO - > bundle_dir: '/workspace/Data'\n", |
165 |
| - "2023-09-06 08:44:11,167 - INFO - > source: 'github'\n", |
166 |
| - "2023-09-06 08:44:11,167 - INFO - > remove_prefix: 'monai_'\n", |
167 |
| - "2023-09-06 08:44:11,168 - INFO - > progress: True\n", |
168 |
| - "2023-09-06 08:44:11,168 - INFO - ---\n", |
| 162 | + "2023-09-07 12:19:11,083 - INFO - --- input summary of monai.bundle.scripts.download ---\n", |
| 163 | + "2023-09-07 12:19:11,086 - INFO - > name: 'spleen_ct_segmentation'\n", |
| 164 | + "2023-09-07 12:19:11,088 - INFO - > bundle_dir: '/workspace/Data'\n", |
| 165 | + "2023-09-07 12:19:11,089 - INFO - > source: 'github'\n", |
| 166 | + "2023-09-07 12:19:11,090 - INFO - > remove_prefix: 'monai_'\n", |
| 167 | + "2023-09-07 12:19:11,091 - INFO - > progress: True\n", |
| 168 | + "2023-09-07 12:19:11,092 - INFO - ---\n", |
169 | 169 | "\n",
|
170 | 170 | "\n",
|
171 |
| - "2023-09-06 08:44:12,165 - INFO - Expected md5 is None, skip md5 check for file /workspace/Data/spleen_ct_segmentation_v0.5.3.zip.\n", |
172 |
| - "2023-09-06 08:44:12,165 - INFO - File exists: /workspace/Data/spleen_ct_segmentation_v0.5.3.zip, skipped downloading.\n", |
173 |
| - "2023-09-06 08:44:12,166 - INFO - Writing into directory: /workspace/Data.\n" |
| 171 | + "2023-09-07 12:19:11,991 - INFO - Expected md5 is None, skip md5 check for file /workspace/Data/spleen_ct_segmentation_v0.5.3.zip.\n", |
| 172 | + "2023-09-07 12:19:11,992 - INFO - File exists: /workspace/Data/spleen_ct_segmentation_v0.5.3.zip, skipped downloading.\n", |
| 173 | + "2023-09-07 12:19:11,994 - INFO - Writing into directory: /workspace/Data.\n" |
174 | 174 | ]
|
175 | 175 | }
|
176 | 176 | ],
|
|
198 | 198 | "workflow_name None\n",
|
199 | 199 | "config_file /workspace/Data/spleen_ct_segmentation/configs/train.json\n",
|
200 | 200 | "workflow_type train\n",
|
201 |
| - "2023-09-06 09:18:47,393 - INFO - --- input summary of monai.bundle.scripts.run ---\n", |
202 |
| - "2023-09-06 09:18:47,395 - INFO - > config_file: '/workspace/Data/spleen_ct_segmentation/configs/train.json'\n", |
203 |
| - "2023-09-06 09:18:47,396 - INFO - > workflow_type: 'train'\n", |
204 |
| - "2023-09-06 09:18:47,397 - INFO - ---\n", |
| 201 | + "2023-09-07 12:19:14,769 - INFO - --- input summary of monai.bundle.scripts.run ---\n", |
| 202 | + "2023-09-07 12:19:14,772 - INFO - > config_file: '/workspace/Data/spleen_ct_segmentation/configs/train.json'\n", |
| 203 | + "2023-09-07 12:19:14,775 - INFO - > workflow_type: 'train'\n", |
| 204 | + "2023-09-07 12:19:14,776 - INFO - ---\n", |
205 | 205 | "\n",
|
206 | 206 | "\n",
|
207 |
| - "2023-09-06 09:18:47,397 - INFO - Setting logging properties based on config: /workspace/Data/spleen_ct_segmentation/configs/logging.conf.\n" |
| 207 | + "2023-09-07 12:19:14,778 - INFO - Setting logging properties based on config: /workspace/Data/spleen_ct_segmentation/configs/logging.conf.\n" |
208 | 208 | ]
|
209 | 209 | }
|
210 | 210 | ],
|
|
395 | 395 | "metadata": {},
|
396 | 396 | "outputs": [],
|
397 | 397 | "source": [
|
| 398 | + "# Here we specify `return_state_dict=False` to return an instantiated model only for compatibility, will remove after MONAI v1.5.\n", |
398 | 399 | "# directly get an instantiated network that loaded the weights.\n",
|
399 |
| - "model = load(name=\"brats_mri_segmentation\", bundle_dir=root_dir, source=\"monaihosting\")\n", |
| 400 | + "model = load(name=\"brats_mri_segmentation\", bundle_dir=root_dir, source=\"monaihosting\", return_state_dict=False)\n", |
400 | 401 | "\n",
|
401 | 402 | "# directly update the parameters for the model from the bundle.\n",
|
402 |
| - "model = load(name=\"brats_mri_segmentation\", bundle_dir=root_dir, source=\"monaihosting\", in_channels=3, out_channels=1)\n", |
| 403 | + "model = load(\n", |
| 404 | + " name=\"brats_mri_segmentation\",\n", |
| 405 | + " bundle_dir=root_dir,\n", |
| 406 | + " source=\"monaihosting\",\n", |
| 407 | + " in_channels=3,\n", |
| 408 | + " out_channels=1,\n", |
| 409 | + " return_state_dict=False,\n", |
| 410 | + ")\n", |
403 | 411 | "\n",
|
404 | 412 | "# using `exclude_vars` to filter loading weights.\n",
|
405 | 413 | "model = load(\n",
|
406 | 414 | " name=\"brats_mri_segmentation\",\n",
|
407 | 415 | " bundle_dir=root_dir,\n",
|
408 | 416 | " source=\"monaihosting\",\n",
|
409 | 417 | " copy_model_args={\"exclude_vars\": \"convInit|conv_final\"},\n",
|
| 418 | + " return_state_dict=False,\n", |
410 | 419 | ")\n",
|
411 | 420 | "\n",
|
412 | 421 | "# pass model and return an instantiated network that loaded the weights.\n",
|
|
0 commit comments