Skip to content

Commit

Permalink
update notebook
Browse files Browse the repository at this point in the history
Signed-off-by: OeslleLucena <oeslle.lucena@gmail.com>
  • Loading branch information
OeslleLucena committed Oct 17, 2023
1 parent 92d9d1a commit 1da1fa0
Showing 1 changed file with 81 additions and 96 deletions.
177 changes: 81 additions & 96 deletions bundle/05_spleen_segmentation_lightning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,64 +144,21 @@
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Traceback (most recent call last):\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/runpy.py\", line 197, in _run_module_as_main\n",
" return _run_code(code, main_globals, None,\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/runpy.py\", line 87, in _run_code\n",
" exec(code, run_globals)\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/site-packages/monai/bundle/__main__.py\", line 31, in <module>\n",
" fire.Fire()\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/site-packages/fire/core.py\", line 141, in Fire\n",
" component_trace = _Fire(component, args, parsed_flag_args, context, name)\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/site-packages/fire/core.py\", line 475, in _Fire\n",
" component, remaining_args = _CallAndUpdateTrace(\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/site-packages/fire/core.py\", line 691, in _CallAndUpdateTrace\n",
" component = fn(*varargs, **kwargs)\n",
" File \"/home/ol18/miniconda3/envs/monai_tutorial/lib/python3.9/site-packages/monai/bundle/scripts.py\", line 1532, in init_bundle\n",
" raise ValueError(f\"Specified bundle directory '{str(bundle_dir)}' already exists\")\n",
"ValueError: Specified bundle directory '/home/ol18/Codes/OpenSourceContributions/tutorials/bundle/SpleenSegLightning' already exists\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"/usr/bin/tree\n",
"SpleenSegLightning\n",
"├── configs\n",
"│   ├── common.yaml\n",
"│   ├── evaluate.yaml\n",
"│   ├── inference.json\n",
"│   ├── metadata.json\n",
"│   └── train.yaml\n",
"│   └── metadata.json\n",
"├── docs\n",
"│   └── README.md\n",
"├── LICENSE\n",
"├── lightning_logs\n",
"│   └── lightning_logs\n",
"│   ├── version_0\n",
"│   │   ├── checkpoints\n",
"│   │   │   └── epoch=0-step=32.ckpt\n",
"│   │   ├── events.out.tfevents.1697542641.sie082-pc.8753.0\n",
"│   │   └── hparams.yaml\n",
"│   └── version_1\n",
"│   ├── events.out.tfevents.1697542689.sie082-pc.9010.0\n",
"│   └── hparams.yaml\n",
"├── models\n",
"└── scripts\n",
" ├── __init__.py\n",
" ├── main.py\n",
" ├── model.py\n",
" └── __pycache__\n",
" ├── __init__.cpython-39.pyc\n",
" ├── main.cpython-39.pyc\n",
" └── model.cpython-39.pyc\n",
"└── models\n",
"\n",
"10 directories, 18 files\n"
"3 directories, 4 files\n"
]
}
],
Expand Down Expand Up @@ -321,7 +278,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting SpleenSegLightning/configs/common.yaml\n"
"Writing SpleenSegLightning/configs/common.yaml\n"
]
}
],
Expand Down Expand Up @@ -382,15 +339,7 @@
"outputs_hidden": false
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mkdir: cannot create directory ‘SpleenSegLightning/scripts’: File exists\n"
]
}
],
"outputs": [],
"source": [
"!mkdir SpleenSegLightning/scripts"
]
Expand All @@ -405,7 +354,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting SpleenSegLightning/scripts/__init__.py\n"
"Writing SpleenSegLightning/scripts/__init__.py\n"
]
}
],
Expand Down Expand Up @@ -434,7 +383,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting SpleenSegLightning/scripts/model.py\n"
"Writing SpleenSegLightning/scripts/model.py\n"
]
}
],
Expand Down Expand Up @@ -567,7 +516,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting SpleenSegLightning/scripts/main.py\n"
"Writing SpleenSegLightning/scripts/main.py\n"
]
}
],
Expand Down Expand Up @@ -625,7 +574,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting SpleenSegLightning/configs/train.yaml\n"
"Writing SpleenSegLightning/configs/train.yaml\n"
]
}
],
Expand Down Expand Up @@ -790,15 +739,15 @@
"bundle_dir ./SpleenSegLightning\n",
"data_dir ./Task09_Spleen\n",
"max_epochs 1\n",
"2023-10-17 16:08:30,470 - INFO - --- input summary of monai.bundle.scripts.run ---\n",
"2023-10-17 16:08:30,470 - INFO - > config_file: ['./SpleenSegLightning/configs/common.yaml',\n",
"2023-10-17 16:46:23,514 - INFO - --- input summary of monai.bundle.scripts.run ---\n",
"2023-10-17 16:46:23,515 - INFO - > config_file: ['./SpleenSegLightning/configs/common.yaml',\n",
" './SpleenSegLightning/configs/train.yaml']\n",
"2023-10-17 16:08:30,470 - INFO - > meta_file: './SpleenSegLightning/configs/metadata.json'\n",
"2023-10-17 16:08:30,471 - INFO - > run_id: 'train'\n",
"2023-10-17 16:08:30,471 - INFO - > bundle_dir: './SpleenSegLightning'\n",
"2023-10-17 16:08:30,471 - INFO - > data_dir: './Task09_Spleen'\n",
"2023-10-17 16:08:30,471 - INFO - > max_epochs: 1\n",
"2023-10-17 16:08:30,471 - INFO - ---\n",
"2023-10-17 16:46:23,515 - INFO - > meta_file: './SpleenSegLightning/configs/metadata.json'\n",
"2023-10-17 16:46:23,515 - INFO - > run_id: 'train'\n",
"2023-10-17 16:46:23,515 - INFO - > bundle_dir: './SpleenSegLightning'\n",
"2023-10-17 16:46:23,515 - INFO - > data_dir: './Task09_Spleen'\n",
"2023-10-17 16:46:23,515 - INFO - > max_epochs: 1\n",
"2023-10-17 16:46:23,515 - INFO - ---\n",
"\n",
"\n"
]
Expand All @@ -809,12 +758,13 @@
"text": [
"monai.bundle.workflows ConfigWorkflow.__init__:workflow_type: Current default value of argument `workflow_type=None` has been deprecated since version 1.2. It will be changed to `workflow_type=train` in version 1.4.\n",
"Default logging file in SpleenSegLightning/configs/logging.conf does not exist, skipping logging.\n",
"Loading dataset: 100%|██████████| 32/32 [00:42<00:00, 1.33s/it]\n",
"Loading dataset: 100%|██████████| 9/9 [00:09<00:00, 1.11s/it]\n",
"Loading dataset: 100%|██████████| 32/32 [00:47<00:00, 1.48s/it]\n",
"Loading dataset: 100%|██████████| 9/9 [00:11<00:00, 1.24s/it]\n",
"GPU available: True (cuda), used: True\n",
"TPU available: False, using: 0 TPU cores\n",
"IPU available: False, using: 0 IPUs\n",
"HPU available: False, using: 0 HPUs\n",
"Missing logger folder: SpleenSegLightning/lightning_logs/lightning_logs\n",
"LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0,1]\n",
"\n",
" | Name | Type | Params\n",
Expand All @@ -833,20 +783,20 @@
"output_type": "stream",
"text": [
"configure_optimizers 0.0001\n",
"Epoch 0: 100%|██████████| 32/32 [00:09<00:00, 3.28it/s, v_num=2]\n",
"Epoch 0: 100%|██████████| 32/32 [00:10<00:00, 3.19it/s, v_num=0]\n",
"Validation: 0it [00:00, ?it/s]\u001b[A\n",
"Validation: 0%| | 0/9 [00:00<?, ?it/s]\u001b[A\n",
"Validation DataLoader 0: 0%| | 0/9 [00:00<?, ?it/s]\u001b[A\n",
"Validation DataLoader 0: 11%|█ | 1/9 [00:00<00:05, 1.49it/s]\u001b[A\n",
"Validation DataLoader 0: 22%|██▏ | 2/9 [00:02<00:08, 1.22s/it]\u001b[A\n",
"Validation DataLoader 0: 33%|███▎ | 3/9 [00:03<00:07, 1.31s/it]\u001b[A\n",
"Validation DataLoader 0: 44%|████▍ | 4/9 [00:06<00:08, 1.69s/it]\u001b[A\n",
"Validation DataLoader 0: 56%|█████▌ | 5/9 [00:09<00:07, 1.86s/it]\u001b[A\n",
"Validation DataLoader 0: 67%|██████▋ | 6/9 [00:10<00:05, 1.78s/it]\u001b[A\n",
"Validation DataLoader 0: 78%|███████▊ | 7/9 [00:11<00:03, 1.71s/it]\u001b[A\n",
"Validation DataLoader 0: 89%|████████▉ | 8/9 [00:13<00:01, 1.64s/it]\u001b[A\n",
"Validation DataLoader 0: 100%|██████████| 9/9 [00:14<00:00, 1.58s/it]\u001b[Acurrent epoch: 0 current mean dice: 0.0346\n",
"best mean dice: 0.0346 at epoch: 0\n",
"Validation DataLoader 0: 11%|█ | 1/9 [00:00<00:05, 1.53it/s]\u001b[A\n",
"Validation DataLoader 0: 22%|██▏ | 2/9 [00:02<00:08, 1.23s/it]\u001b[A\n",
"Validation DataLoader 0: 33%|███▎ | 3/9 [00:03<00:07, 1.32s/it]\u001b[A\n",
"Validation DataLoader 0: 44%|████▍ | 4/9 [00:07<00:09, 1.90s/it]\u001b[A\n",
"Validation DataLoader 0: 56%|█████▌ | 5/9 [00:10<00:08, 2.04s/it]\u001b[A\n",
"Validation DataLoader 0: 67%|██████▋ | 6/9 [00:11<00:05, 1.94s/it]\u001b[A\n",
"Validation DataLoader 0: 78%|███████▊ | 7/9 [00:13<00:03, 1.86s/it]\u001b[A\n",
"Validation DataLoader 0: 89%|████████▉ | 8/9 [00:14<00:01, 1.78s/it]\u001b[A\n",
"Validation DataLoader 0: 100%|██████████| 9/9 [00:15<00:00, 1.68s/it]\u001b[Acurrent epoch: 0 current mean dice: 0.0437\n",
"best mean dice: 0.0437 at epoch: 0\n",
"\n"
]
},
Expand All @@ -861,7 +811,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 0: 100%|██████████| 32/32 [00:24<00:00, 1.30it/s, v_num=2] \u001b[A\n"
"Epoch 0: 100%|██████████| 32/32 [00:25<00:00, 1.24it/s, v_num=0] \u001b[A\n"
]
}
],
Expand Down Expand Up @@ -896,9 +846,44 @@
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/usr/bin/tree\n",
"\u001b[01;34mSpleenSegLightning\u001b[00m\n",
"├── \u001b[01;34mconfigs\u001b[00m\n",
"│   ├── common.yaml\n",
"│   ├── inference.json\n",
"│   ├── metadata.json\n",
"│   └── train.yaml\n",
"├── \u001b[01;34mdocs\u001b[00m\n",
"│   └── README.md\n",
"├── LICENSE\n",
"├── \u001b[01;34mlightning_logs\u001b[00m\n",
"│   └── \u001b[01;34mlightning_logs\u001b[00m\n",
"│   └── \u001b[01;34mversion_0\u001b[00m\n",
"│   ├── \u001b[01;34mcheckpoints\u001b[00m\n",
"│   │   └── epoch=0-step=32.ckpt\n",
"│   ├── events.out.tfevents.1697557642.sie082-pc.16466.0\n",
"│   └── hparams.yaml\n",
"├── \u001b[01;34mmodels\u001b[00m\n",
"└── \u001b[01;34mscripts\u001b[00m\n",
" ├── __init__.py\n",
" ├── main.py\n",
" ├── model.py\n",
" └── \u001b[01;34m__pycache__\u001b[00m\n",
" ├── __init__.cpython-39.pyc\n",
" ├── main.cpython-39.pyc\n",
" └── model.cpython-39.pyc\n",
"\n",
"9 directories, 15 files\n"
]
}
],
"source": [
"# !which tree && tree SpleenSegLightning || true"
"!which tree && tree SpleenSegLightning || true"
]
},
{
Expand Down Expand Up @@ -943,7 +928,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Overwriting SpleenSegLightning/configs/evaluate.yaml\n"
"Writing SpleenSegLightning/configs/evaluate.yaml\n"
]
}
],
Expand Down Expand Up @@ -1048,15 +1033,15 @@
"bundle_dir ./SpleenSegLightning\n",
"data_dir ./Task09_Spleen\n",
"ckpt_file ./epoch=599-step=9600.ckpt\n",
"2023-10-17 16:09:59,969 - INFO - --- input summary of monai.bundle.scripts.run ---\n",
"2023-10-17 16:09:59,969 - INFO - > config_file: ['./SpleenSegLightning/configs/common.yaml',\n",
"2023-10-17 16:48:01,076 - INFO - --- input summary of monai.bundle.scripts.run ---\n",
"2023-10-17 16:48:01,076 - INFO - > config_file: ['./SpleenSegLightning/configs/common.yaml',\n",
" './SpleenSegLightning/configs/evaluate.yaml']\n",
"2023-10-17 16:09:59,969 - INFO - > meta_file: './SpleenSegLightning/configs/metadata.json'\n",
"2023-10-17 16:09:59,969 - INFO - > run_id: 'evaluate'\n",
"2023-10-17 16:09:59,969 - INFO - > bundle_dir: './SpleenSegLightning'\n",
"2023-10-17 16:09:59,969 - INFO - > data_dir: './Task09_Spleen'\n",
"2023-10-17 16:09:59,969 - INFO - > ckpt_file: './epoch=599-step=9600.ckpt'\n",
"2023-10-17 16:09:59,969 - INFO - ---\n",
"2023-10-17 16:48:01,076 - INFO - > meta_file: './SpleenSegLightning/configs/metadata.json'\n",
"2023-10-17 16:48:01,076 - INFO - > run_id: 'evaluate'\n",
"2023-10-17 16:48:01,076 - INFO - > bundle_dir: './SpleenSegLightning'\n",
"2023-10-17 16:48:01,076 - INFO - > data_dir: './Task09_Spleen'\n",
"2023-10-17 16:48:01,076 - INFO - > ckpt_file: './epoch=599-step=9600.ckpt'\n",
"2023-10-17 16:48:01,076 - INFO - ---\n",
"\n",
"\n"
]
Expand All @@ -1067,7 +1052,7 @@
"text": [
"monai.bundle.workflows ConfigWorkflow.__init__:workflow_type: Current default value of argument `workflow_type=None` has been deprecated since version 1.2. It will be changed to `workflow_type=train` in version 1.4.\n",
"Default logging file in SpleenSegLightning/configs/logging.conf does not exist, skipping logging.\n",
"Loading dataset: 100%|██████████| 9/9 [00:10<00:00, 1.14s/it]\n",
"Loading dataset: 100%|██████████| 9/9 [00:10<00:00, 1.12s/it]\n",
"GPU available: True (cuda), used: True\n",
"TPU available: False, using: 0 TPU cores\n",
"IPU available: False, using: 0 IPUs\n",
Expand All @@ -1081,9 +1066,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Validation DataLoader 0: 100%|██████████| 9/9 [00:16<00:00, 1.80s/it]current epoch: 0 current mean dice: 0.9123\n",
"Validation DataLoader 0: 100%|██████████| 9/9 [00:17<00:00, 1.90s/it]current epoch: 0 current mean dice: 0.9123\n",
"best mean dice: 0.9123 at epoch: 0\n",
"Validation DataLoader 0: 100%|██████████| 9/9 [00:16<00:00, 1.80s/it]\n"
"Validation DataLoader 0: 100%|██████████| 9/9 [00:17<00:00, 1.90s/it]\n"
]
}
],
Expand Down

0 comments on commit 1da1fa0

Please sign in to comment.