Skip to content

Commit

Permalink
Erstellt mit Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaumann committed Aug 11, 2023
1 parent 4c6aed8 commit 502cc61
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions MIMO_U_Net_NYUv2_depth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"colab": {
"provenance": [],
"machine_shape": "hm",
"gpuType": "A100",
"authorship_tag": "ABX9TyNQpLPXPrsI/Jz/rFHEykpn",
"gpuType": "V100",
"authorship_tag": "ABX9TyPKimDc7cpriM4H1Jq4F/fn",
"include_colab_link": true
},
"kernelspec": {
Expand Down Expand Up @@ -38,6 +38,17 @@
"id": "nQEexLS70FwV"
}
},
{
"cell_type": "code",
"source": [
"%load_ext tensorboard"
],
"metadata": {
"id": "U3ohfXOm3iPC"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
Expand Down Expand Up @@ -70,7 +81,7 @@
"\n",
"import lightning.pytorch as pl\n",
"from lightning.pytorch.callbacks.model_checkpoint import ModelCheckpoint\n",
"from lightning.pytorch.loggers import WandbLogger\n",
"from lightning.pytorch.loggers import WandbLogger, TensorBoardLogger\n",
"\n",
"from mimo.models.mimo_unet import MimoUnetModel\n",
"from mimo.tasks.depth.nyuv2_datamodule import NYUv2DepthDataModule\n",
Expand Down Expand Up @@ -98,7 +109,6 @@
" filename=\"epoch-{epoch}-step-{step}-valloss-{val_loss:.8f}-mae-{metric_val/mae_epoch:.8f}\",\n",
" auto_insert_metric_name=False,\n",
" ),\n",
" WandbMetricsDefiner(),\n",
" ]\n",
" callbacks += callbacks_validation\n",
" return callbacks"
Expand Down Expand Up @@ -152,9 +162,7 @@
" seed=1,\n",
")\n",
"\n",
"wandb_logger = WandbLogger(\n",
" project='Colab MIMO-Unet Example',\n",
" log_model=True, #save model on wandb\n",
"tensorboard_logger = TensorBoardLogger(\n",
" save_dir='/content/logs',\n",
")\n",
"\n",
Expand All @@ -166,7 +174,7 @@
" max_epochs=15,\n",
" default_root_dir='/content/runs',\n",
" log_every_n_steps=200,\n",
" logger=wandb_logger,\n",
" logger=tensorboard_logger,\n",
")"
],
"metadata": {
Expand All @@ -178,10 +186,10 @@
{
"cell_type": "code",
"source": [
"model.compile()"
"%tensorboard --logdir /content/logs"
],
"metadata": {
"id": "1xGcLXRuUv1f"
"id": "Glu27Z6lFu0n"
},
"execution_count": null,
"outputs": []
Expand All @@ -190,8 +198,7 @@
"cell_type": "code",
"source": [
"trainer.started_at = str(datetime.now().isoformat(timespec=\"seconds\"))\n",
"trainer.fit(model, dm)\n",
"wandb_logger.experiment.finish()"
"trainer.fit(model, dm)"
],
"metadata": {
"id": "zpuDgLIMeN63"
Expand Down Expand Up @@ -323,15 +330,6 @@
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "eRL3keIx-Rg6"
},
"execution_count": null,
"outputs": []
}
]
}

0 comments on commit 502cc61

Please sign in to comment.