Skip to content

Commit

Permalink
pretrained model
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Salmon committed Aug 21, 2024
1 parent 96cf4f3 commit 14ca1b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions 03_COSDD/bonus-solution-generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"\n",
"### Task 3.1.\n",
"\n",
"Load the model trained in the first notebook by entering your `model_name`, or alternatively uncomment line 4 to load the pretrained model.\n",
"Load the model trained in the first notebook by entering your `model_name`, or alternatively, uncomment line 4 to load the pretrained model.\n",
"</div>"
]
},
Expand All @@ -78,7 +78,7 @@
"model_name = ... # Insert a string here\n",
"checkpoint_path = os.path.join(\"checkpoints\", model_name)\n",
"\n",
"# checkpoint_path = TODO: Add pretrained\n",
"# checkpoint_path = \"checkpoints/mito-confocal-pretrained\"\n",
"\n",
"hub = Hub.load_from_checkpoint(os.path.join(checkpoint_path, \"final_model.ckpt\")).cuda()"
]
Expand All @@ -96,7 +96,7 @@
"model_name = \"mito-confocal\" # Insert a string here\n",
"checkpoint_path = os.path.join(\"checkpoints\", model_name)\n",
"\n",
"# checkpoint_path = TODO: Add pretrained\n",
"# checkpoint_path = \"checkpoints/mito-confocal-pretrained\"\n",
"\n",
"hub = Hub.load_from_checkpoint(os.path.join(checkpoint_path, \"final_model.ckpt\")).cuda()"
]
Expand Down
8 changes: 5 additions & 3 deletions 03_COSDD/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@
"2. Enter `conda activate 05_image_restoration` to activate an environment with Tensorboard installed.\n",
"3. Enter `tensorboard --logdir 05_image_restoration/03_COSDD/checkpoints`\n",
"4. Finally, open a browser and enter localhost:6006 in the address bar.\n",
"\n",
"Once you're in tensorboard, you'll see the training logs of your model and the logs of a model that's been trained for 3.5 hours.\n",
"</div>"
]
},
Expand Down Expand Up @@ -854,7 +856,7 @@
"\n",
"Our model was only trained for 10 minutes. This is long enough to get some denoising results, but a model trained for longer would do better. In the cell below, load the trained model by recalling the value you gave for `model_name`. Then procede through the notebook to look at how well it performs. \n",
"\n",
"Once you reach the end of the notebook, return to this cell to load a model that has been trained for 24 hours by uncommenting line 4, then run the notebook again to see how much difference the extra training time makes.\n",
"Once you reach the end of the notebook, return to this cell to load a model that has been trained for 3.5 hours by uncommenting line 4, then run the notebook again to see how much difference the extra training time makes. \n",
"</div>"
]
},
Expand All @@ -867,7 +869,7 @@
"model_name = ... ### Insert a string here\n",
"checkpoint_path = os.path.join(\"checkpoints\", model_name)\n",
"\n",
"# checkpoint_path = TODO: Add pretrained checkpoint ### Once you reach the bottom of the notebook, return here and uncomment this line to see the pretrained model\n",
"# checkpoint_path = \"checkpoints/mito-confocal-pretrained\" ### Once you reach the bottom of the notebook, return here and uncomment this line to see the pretrained model\n",
"\n",
"hub = Hub.load_from_checkpoint(os.path.join(checkpoint_path, \"final_model.ckpt\"))\n",
"\n",
Expand All @@ -890,7 +892,7 @@
"model_name = \"mito-confocal\" ### Insert a string here\n",
"checkpoint_path = os.path.join(\"checkpoints\", model_name)\n",
"\n",
"# checkpoint_path = TODO: Add pretrained checkpoint ### Once you reach the bottom of the notebook, return here and uncomment this line to see the pretrained model\n",
"# checkpoint_path = \"checkpoints/mito-confocal-pretrained\" ### Once you reach the bottom of the notebook, return here and uncomment this line to see the pretrained model\n",
"\n",
"hub = Hub.load_from_checkpoint(os.path.join(checkpoint_path, \"final_model.ckpt\"))\n",
"\n",
Expand Down
4 changes: 4 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ if [[ "$CONDA_DEFAULT_ENV" == "$ENV" ]]; then
cd ER/
gdown 1Bho6Oymfxi7OV0tPb9wkINkVOCpTaL7M
cd ../../
mkdir 03_COSDD/checkpoints
cd 03_COSDD/checkpoints
gdown --folder 1_oUAxagFVin71xFASb9oLF6pz20HjqTr
cd ../../
fi


0 comments on commit 14ca1b9

Please sign in to comment.