Skip to content

1366-fix-deepatlas-ssim-loss-issue #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 14 additions & 28 deletions deep_atlas/deep_atlas_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"\n",
"This notebook works with 3D images and segmentations, and it results in two trained models: a segmentation network `seg_net` and a registration network `reg_net`. There are two training phases: a pre-training phase for the segmentation network alone, and an alternating training phase for the two networks together. Use of the trained models for inference is demonstrated at the end of the notebook.\n",
"\n",
"Please note that this notebook is verified to work well on the NVIDIA H100/A100/V100 GPU. However, there is a problem in the `Train Networks` part when running on the NVIDIA L40/3090Ti/3080Ti GPU. Track this [issue](https://github.com/Project-MONAI/tutorials/issues/1336) for more detail.\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/deep_atlas/deep_atlas_tutorial.ipynb)\n",
"\n",
"---\n",
Expand Down Expand Up @@ -146,9 +144,7 @@
"cell_type": "code",
"execution_count": 2,
"id": "576b9aa6",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stderr",
Expand Down Expand Up @@ -215,6 +211,11 @@
"# Set deterministic training for reproducibility\n",
"monai.utils.set_determinism(seed=2938649572)\n",
"\n",
"# Turn off the TF32 precision. Otherwise, because of the rounding error, the ssim_loss will be a weird value on some Ampere GPUs, like L40, 3090Ti and 3080Ti.\n",
"# Track this issue (https://github.com/Project-MONAI/tutorials/issues/1336) for more detail.\n",
"torch.backends.cuda.matmul.allow_tf32 = False\n",
"torch.backends.cudnn.allow_tf32 = False\n",
"\n",
"monai.config.print_config()"
]
},
Expand Down Expand Up @@ -718,9 +719,7 @@
"cell_type": "code",
"execution_count": 16,
"id": "0a020fc2",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -1233,9 +1232,7 @@
"cell_type": "code",
"execution_count": null,
"id": "fbbc25b5",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"# Training cell\n",
Expand Down Expand Up @@ -1605,9 +1602,7 @@
"cell_type": "code",
"execution_count": 39,
"id": "11402c6e",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"# The following are dictionaries that map segmentation availability labels 00,10,01,11 to MONAI dataloaders\n",
Expand Down Expand Up @@ -1690,9 +1685,7 @@
"cell_type": "code",
"execution_count": 41,
"id": "bfdacfa6",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -1718,7 +1711,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c95101e5",
"metadata": {},
Expand Down Expand Up @@ -1758,9 +1750,7 @@
"cell_type": "code",
"execution_count": null,
"id": "ef8af785",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [],
"source": [
"# Training cell\n",
Expand Down Expand Up @@ -1954,9 +1944,7 @@
"cell_type": "code",
"execution_count": 43,
"id": "050dd7b0",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -2169,9 +2157,7 @@
"cell_type": "code",
"execution_count": 60,
"id": "5801a48e",
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -2489,7 +2475,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down