-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
186 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "8Hn3VNXl-wea" | ||
}, | ||
"source": [ | ||
"If you make any changes to files in drive you need to restart session (see the 'Runtime' menu) and then re-mount the drive.\n", | ||
"\n", | ||
"Alternatively you can make changes locally on a specific branch and then git clone the branch after making changes.\n", | ||
"\n", | ||
"Take advantage of GPU by setting Runtime to GPU." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "20Q9qbstc0aa", | ||
"outputId": "f9a6b223-5f08-48a3-ec34-502c77aea2bd" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from google.colab import drive\n", | ||
"drive.mount('/content/drive', force_remount=True)\n", | ||
"%cd /content/drive/MyDrive/colab/ml_template\n", | ||
"# ctrl click on path to open it to the left" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "QSOU6HYz9vlE" | ||
}, | ||
"source": [ | ||
"**Download data on drive**\n", | ||
"\n", | ||
"To access data efficiently need to upload it as a zip and then unzip to '/content'\n", | ||
"\n", | ||
"[link to issue on stack overflow.](https://stackoverflow.com/questions/59120853/google-colab-is-so-slow-while-reading-images-from-google-drive)\n", | ||
"\n", | ||
"Also need to set: 'datamodule.dir_parent=/content/'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "zw0LHMDreU3K" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# for eurosat_rgb dataset\n", | ||
"!unzip \"/content/drive/MyDrive/colab/ml_template/datasets/eurosat_rgb.zip\" -d \"/content\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "C7xLvON9aySI" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# for waterbodies dataset\n", | ||
"!unzip \"/content/drive/MyDrive/colab/ml_template/datasets/waterbodies.zip\" -d \"/content\"" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "VTlqECwrc1zX" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"!pip install -r reqs_colab.txt" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "6ZHj1SI0_dbd" | ||
}, | ||
"source": [ | ||
"**Log in to wandb**\n", | ||
"\n", | ||
"You do not need to log in if you set logger.mode=offline" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/", | ||
"height": 121 | ||
}, | ||
"id": "GV8nh0vXd5Uu", | ||
"outputId": "a80480df-f919-4ad1-ba00-3411cb940776" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import wandb\n", | ||
"wandb.login()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "oBTSjbjqkG0x", | ||
"outputId": "a33b6bf6-7a00-41cf-b239-ee521e7d4e2a" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# double check that you are in the project directory:\n", | ||
"%cd /content/drive/MyDrive/colab/ml_template" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "CyVRyQYkzPXo" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# to do: why are plots not showing? neither of these seem to work\n", | ||
"# %matplotlib inline\n", | ||
"# %matplotlib notebook" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/" | ||
}, | ||
"id": "i4OrXFdNJeFB", | ||
"outputId": "7e5d82dc-670a-4d3b-f08a-2de8c3d8d8ad" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"!python src/traintest.py datamodule=eurosat_rgb model=cnn" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"accelerator": "GPU", | ||
"colab": { | ||
"gpuType": "T4", | ||
"provenance": [] | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |