* add neptune integration

* improve readme

* quick fix

* improve datamodule

* remove unnecessary folders from .gitignore

* change folder structure

* add optuna config

* add bash tests

* redesign readme.md

* change wandb callbacks names

* fix wandb callbacks

* resolve issues with sweeping alongside wandb

* improve rich config printing

* update readme

* Update README.md
This commit is contained in:
Luke authored and GitHub committed 2021-03-01 15:00:10 +01:00
1 parent bcf4146553
commit 036aec4914
56 files changed
+1294 -837

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
# import os, sys
# sys.path.insert(1, os.path.join(sys.path[0], ".."))
# print(os.path.abspath(os.curdir))
#####################################################
# python hydra_wandb_test.py -m +some_param=1,2,3,4
#####################################################
import hydra
import wandb
@hydra.main(config_path="../configs/", config_name="config.yaml")
def main(config):
wandb.init(project="env_tests")
wandb.finish()
if __name__ == "__main__":
main()
+21
View File
@@ -0,0 +1,21 @@
# TESTS FOR DIFFERENT LOGGERS
# TO EXECUTE:
# bash tests/logger_tests.sh
# conda activate testenv
# Test CSV logger
echo TEST 1
python train.py logger=csv_logger trainer.min_epochs=3 trainer.max_epochs=3 trainer.gpus=1
# # Test Weights&Biases logger
echo TEST 2
python train.py logger=wandb logger.wandb.project="env_tests" trainer.min_epochs=10 trainer.max_epochs=10 trainer.gpus=1
# Test TensorBoard logger
echo TEST 3
python train.py logger=tensorboard trainer.min_epochs=10 trainer.max_epochs=10 trainer.gpus=1
# Test many loggers at once
echo TEST 4
python train.py logger=many_loggers trainer.min_epochs=10 trainer.max_epochs=10 trainer.gpus=1
+35
View File
@@ -0,0 +1,35 @@
# THESE ARE JUST A COUPLE OF QUICK EXPERIMENTS TO TEST IF YOUR MODEL DOESN'T CRASH UNDER DIFFERENT CONDITIONS
# TO EXECUTE:
# bash tests/quick_tests.sh
# conda activate testenv
# Test for CPU
echo TEST 1
python train.py trainer.gpus=0 trainer.max_epochs=1
# Test for GPU
echo TEST 2
python train.py trainer.gpus=1 trainer.max_epochs=1
# Test multiple workers and cuda pinned memory
echo TEST 3
python train.py trainer.gpus=1 trainer.max_epochs=2 \
datamodule.num_workers=4 datamodule.pin_memory=True
# Test all experiment configs
echo TEST 4
python train.py -m '+experiment=glob(*)' trainer.gpus=1 trainer.max_epochs=3
# Test with debug trainer
echo TEST 5
python train.py trainer=debug_trainer
# Overfit to 10 bathes
echo TEST 6
python train.py trainer.min_epochs=20 trainer.max_epochs=20 +trainer.overfit_batches=10
# Test default hydra sweep over hyperparameters (runs 4 different combinations for 1 epoch)
echo TEST 7
python train.py -m datamodule.batch_size=32,64 model.lr=0.001,0.003 \
trainer.gpus=1 trainer.max_epochs=1
+28
View File
@@ -0,0 +1,28 @@
# TESTS FOR HYPERPARAMETER SWEEPS
# TO EXECUTE:
# bash tests/sweep_tests.sh
# conda activate testenv
# currently there are some issues with running sweeps alongside wandb
# https://github.com/wandb/client/issues/1314
# this env variable fixes that
export WANDB_START_METHOD=thread
# Test default hydra sweep with wandb logging
echo TEST 1
python train.py -m datamodule.batch_size=64,128 model.lr=0.001,0.003 \
+experiment=exp_example_simple \
trainer.gpus=1 trainer.max_epochs=2 seed=12345 \
datamodule.num_workers=12 datamodule.pin_memory=True \
logger=wandb logger.wandb.project="env_tests" logger.wandb.group="DefaultSweep_MNIST_SimpleDenseNet"
# Test optuna sweep with wandb logging
echo TEST 2
python train.py -m --config-name config_optuna.yaml \
+experiment=exp_example_simple \
trainer.gpus=1 trainer.max_epochs=5 seed=12345 \
datamodule.num_workers=12 datamodule.pin_memory=True \
logger=wandb logger.wandb.project="env_tests" logger.wandb.group="Optuna_MNIST_SimpleDenseNet"