Skip to content

Commit

Permalink
Commit from GitHub Actions (Build Notebooks)
Browse files Browse the repository at this point in the history
  • Loading branch information
edyoshikun committed Aug 25, 2024
1 parent e4850dc commit 34ab305
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
17 changes: 13 additions & 4 deletions exercise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,9 @@
"cell_type": "code",
"execution_count": null,
"id": "1d678c03",
"metadata": {},
"metadata": {
"lines_to_next_cell": 0
},
"outputs": [],
"source": [
"# Check if GPU is available\n",
Expand All @@ -986,7 +988,11 @@
" ),\n",
")\n",
"# Launch training and check that loss and images are being logged on tensorboard.\n",
"trainer.fit(phase2fluor_model, datamodule=phase2fluor_2D_data)"
"trainer.fit(phase2fluor_model, datamodule=phase2fluor_2D_data)\n",
"\n",
"# Move the model to the GPU.\n",
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
"phase2fluor_model.to(device)"
]
},
{
Expand Down Expand Up @@ -1322,8 +1328,11 @@
"pretrained_phase2fluor = VSUNet.load_from_checkpoint(\n",
" pretrained_model_ckpt,\n",
" architecture=...,\n",
" module_config=phase2fluor_config,\n",
")"
" model_config=phase2fluor_config,\n",
" accelerator='gpu'\n",
")\n",
"# TODO: Setup the dataloader in evaluation/predict mode\n",
"#"
]
},
{
Expand Down
13 changes: 10 additions & 3 deletions solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,9 @@
"cell_type": "code",
"execution_count": null,
"id": "b5539a48",
"metadata": {},
"metadata": {
"lines_to_next_cell": 0
},
"outputs": [],
"source": [
"# Check if GPU is available\n",
Expand All @@ -970,7 +972,11 @@
" ),\n",
")\n",
"# Launch training and check that loss and images are being logged on tensorboard.\n",
"trainer.fit(phase2fluor_model, datamodule=phase2fluor_2D_data)"
"trainer.fit(phase2fluor_model, datamodule=phase2fluor_2D_data)\n",
"\n",
"# Move the model to the GPU.\n",
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
"phase2fluor_model.to(device)"
]
},
{
Expand Down Expand Up @@ -1285,7 +1291,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5cb1fcdf",
"id": "a1c5193f",
"metadata": {
"lines_to_next_cell": 0,
"tags": [
Expand Down Expand Up @@ -1317,6 +1323,7 @@
" pretrained_model_ckpt,\n",
" architecture=\"UNeXt2_2D\",\n",
" model_config = phase2fluor_config,\n",
" accelerator='gpu'\n",
")\n",
"pretrained_phase2fluor.eval()\n",
"\n",
Expand Down

0 comments on commit 34ab305

Please sign in to comment.