Last active
March 20, 2021 14:57
-
-
Save morganmcg1/7efefc5dabac971a8198c3e2f6dd15a6 to your computer and use it in GitHub Desktop.
Colab auto-click, prevent close due to inactivity
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
In case you want to use this google colab to fine-tune your model, you should make sure that | |
your training doesn't stop due to inactivity. A simple hack to prevent this is to paste the | |
following code into the console of this tab (right mouse click -> inspect -> Console tab and insert code). | |
``` | |
function ConnectButton(){ | |
console.log("Connect pushed"); | |
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click() | |
} | |
setInterval(ConnectButton,60000); | |
``` | |
OR: | |
I’m training on Google Cloud with 2 T4 GPUs, which are quite inexpensive and using screen to keep the code running, even if SSH disconnects for any reason. Steps to run screen properly: | |
$ script /dev/null | |
$ screen | |
ENTER | |
$ python training.py | |
CLOSE WINDOW | |
To check what part of the code is running, SSH again an run: | |
$ screen -r | |
3310.pts-6.training | |
$ screen -d -r 3310 | |
To quit screen: | |
$ screen -X -S 3310.pts-6.training quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment