:free: Access to free kaggle compute power from your command line.
Here's what your runs could look like on Weights and biases...
:sos: How to use?
pip install kaggle
__kaggle_login.py
:warning: do not push it to git:bulb: What to customize?
NB_ID = "training-notebook" # This will be the name which appears on Kaggle.
GIT_USER = "balthazarneveu" # Your git user name
GIT_REPO = "mva_pepites" # Your current git repo
KAGGLE_DATASET_LIST = [] # Keep free unless you need to acess kaggle datasets. You'll need to modify the remote_training_template.ipynb.
Note: you can add kaggle datasets (if you need to put 4Gb of data, it's possible to host it with Kaggle datasets). Fill the
KAGGLE_DATASET_LIST
. You'll also have to customize the remote_training_template.ipynb to unzip and acess datasets.
You can run several experiments in a row using
-e 1 2 3
. If initialization is long (decompress datasets, preprocess etc...), it may be worth running several experiments in a row.
:id: Keep track of experiments by an integer id.
Each experiment is defined by:
:test_tube: Code to define new experiments
kaggle_users = {
"user1": {
"username": "user1_kaggle_name",
"key": "user1_kaggle_key"
},
"user2": {
"username": "user2_kaggle_name",
"key": "user2_kaggle_key"
},
}
:warning: Do not push these secret tokens to github and leak it publicly :facepalm:
Run python remote_training.py -u user1 -e X -nowb
This will create a dedicated folder for training a specific experiment with a dedicated notebook.
-p
(--push
) will upload/push the notebook and run it.-d
(--download
) to download the training results and save it to disk. This is not automatic
python remote_training.py -u user1 -e 0 --cpu --push -nowb
- use
--cpu
to setup at the begining (avoid using GPU when you set up :warning: )- Go to kaggle and check your notifications to access your notebook.
- Edit notebook manually
- allow internet requires your permission (internet is required to clone the git)
- :phone: a verified kaggle account is required
- :key: Allow Kaggle secrets to access wandb:
wandb_api_key
: weights and biases API key.- You'll need to manually edit the notebook under kaggle web page to allow secrets.
- Quick save your notebook.
- Now run the remote training script again, this should execute.
:heart: Don't be scared, the provided experiments will go very fast (less than 2 minutes to run on kaggle).
python train.py -e 0 1
:warning: This is fully experimental, there are probably much better ways to wrap an existing training script.
:mag: Want to contribute, new features, spotted a bug under your OS? file an issue here
:key: It is possible to work with private github repositories but it will require your github token to be inserted into kaggle secrets.
:star: Give a star to this repo if you're planning using it.