Skip to content

Commit 31e5a73

Browse files
committed
Example works now
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent e5e2c84 commit 31e5a73

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

generation/3d_ddpm/3d_ddpm_tutorial.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
{
5858
"cell_type": "code",
59-
"execution_count": 1,
59+
"execution_count": null,
6060
"id": "cdea37d5",
6161
"metadata": {},
6262
"outputs": [
@@ -120,7 +120,7 @@
120120
" LoadImaged,\n",
121121
" Resized,\n",
122122
" ScaleIntensityd,\n",
123-
" ScaleIntensityRangePercentilesd\n",
123+
" ScaleIntensityRangePercentilesd,\n",
124124
")\n",
125125
"from monai.utils import set_determinism\n",
126126
"from monai.inferers import DiffusionInferer\n",
@@ -159,7 +159,7 @@
159159
}
160160
],
161161
"source": [
162-
"directory = os.path.abspath(\"./data\") # os.environ.get(\"MONAI_DATA_DIRECTORY\")\n",
162+
"directory = os.environ.get(\"MONAI_DATA_DIRECTORY\")\n",
163163
"root_dir = tempfile.mkdtemp() if directory is None else directory\n",
164164
"print(root_dir)"
165165
]
@@ -223,7 +223,7 @@
223223
},
224224
{
225225
"cell_type": "code",
226-
"execution_count": 9,
226+
"execution_count": null,
227227
"id": "ddd61e60",
228228
"metadata": {
229229
"lines_to_next_cell": 2
@@ -247,7 +247,7 @@
247247
" task=\"Task01_BrainTumour\",\n",
248248
" transform=data_transform,\n",
249249
" section=\"training\",\n",
250-
" download=False, #True,\n",
250+
" download=True,\n",
251251
" num_workers=num_workers,\n",
252252
")\n",
253253
"\n",
@@ -260,7 +260,7 @@
260260
" task=\"Task01_BrainTumour\",\n",
261261
" transform=data_transform,\n",
262262
" section=\"validation\",\n",
263-
" download=False, #True,\n",
263+
" download=True,\n",
264264
" num_workers=num_workers,\n",
265265
")\n",
266266
"\n",
@@ -393,14 +393,14 @@
393393
},
394394
{
395395
"cell_type": "code",
396-
"execution_count": 13,
396+
"execution_count": null,
397397
"id": "6c1de5ad",
398398
"metadata": {},
399399
"outputs": [],
400400
"source": [
401401
"num_train_timesteps = 1000\n",
402402
"scheduler = DDPMScheduler(\n",
403-
" num_train_timesteps=num_train_timesteps #, schedule=\"scaled_linear_beta\", beta_start=0.0005, beta_end=0.0195, clip_sample=False\n",
403+
" num_train_timesteps=num_train_timesteps # , schedule=\"scaled_linear_beta\", beta_start=0.0005, beta_end=0.0195, clip_sample=False\n",
404404
")"
405405
]
406406
},
@@ -468,7 +468,7 @@
468468
},
469469
{
470470
"cell_type": "code",
471-
"execution_count": 16,
471+
"execution_count": null,
472472
"id": "bd10b595",
473473
"metadata": {
474474
"lines_to_next_cell": 0
@@ -653,7 +653,7 @@
653653
" if (epoch + 1) % val_interval == 0:\n",
654654
" model.eval()\n",
655655
"\n",
656-
" torch.save(model.state_dict(),f\"model_{epoch:04}.pth\")\n",
656+
" torch.save(model.state_dict(), f\"model_{epoch:04}.pth\")\n",
657657
"\n",
658658
" val_epoch_loss = 0\n",
659659
" for step, batch in enumerate(val_loader):\n",

0 commit comments

Comments
 (0)