Release/1.1 (#174)

* introduce different running modes: default, debug, experiment
* fix pytorch installation in setup_conda.sh
* fix incorrect calculation of precision, recall and f1 score in wandb callback
* add `_self_` to config.yaml for compatibility with hydra1.1
* fix setting seed in `train.py` so it's skipped when `seed=null`
* add exception message when trying to use wandb callbacks with `trainer.fast_dev_run=true`
* change `axis=-1` to `dim=-1` in LogImagePredictions callback
* add 'Reproducibilty' section to README.md
This commit is contained in:
Łukasz Zalewski authored and GitHub committed 2021-09-28 20:07:40 +02:00
1 parent 89b502b090
commit 86f30fb320
19 files changed
+131 -81

No files matched your search

+10 -9
View File
@@ -2,17 +2,18 @@
# specify here default training configuration
defaults:
- _self_
- trainer: default.yaml
- model: mnist_model.yaml
- datamodule: mnist_datamodule.yaml
- callbacks: default.yaml # set this to null if you don't want to use callbacks
- callbacks: default.yaml
- logger: null # set logger here or use command line (e.g. `python run.py logger=wandb`)
- mode: default.yaml
- experiment: null
- hparams_search: null
- hydra: default.yaml
# enable color logging
- override hydra/hydra_logging: colorlog
- override hydra/job_logging: colorlog
@@ -26,12 +27,6 @@ work_dir: ${hydra:runtime.cwd}
# path to folder with data
data_dir: ${work_dir}/data/
# use `python run.py debug=true` for easy debugging!
# this will run 1 train, val and test loop with only 1 batch
# equivalent to running `python run.py trainer.fast_dev_run=true`
# (this is placed here just for easier access from command line)
debug: False
# pretty print config at the start of the run using Rich library
print_config: True
@@ -41,3 +36,9 @@ ignore_warnings: True
# check performance on test set, using the best model achieved during training
# lightning chooses best model based on metric specified in checkpoint callback
test_after_training: True
# seed for random number generators in pytorch, numpy and python.random
seed: null
# name of the run, accessed by loggers
name: null
+1 -1
View File
@@ -4,7 +4,7 @@
# python run.py experiment=example_simple.yaml
defaults:
- override /trainer: default.yaml # choose trainer from 'configs/trainer/'
- override /trainer: default.yaml
- override /model: mnist_model.yaml
- override /datamodule: mnist_datamodule.yaml
- override /callbacks: default.yaml
-1
View File
@@ -3,7 +3,6 @@
# example hyperparameter optimization of some experiment with Optuna:
# python run.py -m hparams_search=mnist_optuna experiment=example_simple
# python run.py -m hparams_search=mnist_optuna experiment=example_simple hydra.sweeper.n_trials=30
# python run.py -m hparams_search=mnist_optuna experiment=example_simple logger=wandb
defaults:
- override /hydra/sweeper: optuna
-12
View File
@@ -1,12 +0,0 @@
# output paths for hydra logs
run:
dir: logs/runs/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: logs/multiruns/${now:%Y-%m-%d_%H-%M-%S}
subdir: ${hydra.job.num}
# you can set here environment variables that are universal for all users
# for system specific variables (like data paths) it's better to use .env file!
job:
env_set:
EXAMPLE_VAR: "example_value"
+2 -2
View File
@@ -2,6 +2,6 @@
comet:
_target_: pytorch_lightning.loggers.comet.CometLogger
api_key: ${oc.env:COMET_API_TOKEN} # api key is laoded from environment variable
api_key: ${oc.env:COMET_API_TOKEN} # api key is loaded from environment variable
project_name: "template-tests"
experiment_name: null
experiment_name: ${name}
+1 -1
View File
@@ -4,5 +4,5 @@ csv:
_target_: pytorch_lightning.loggers.csv_logs.CSVLogger
save_dir: "."
name: "csv/"
version: null
version: ${name}
prefix: ""
-1
View File
@@ -1,7 +1,6 @@
# train with many loggers at once
defaults:
# - aim.yaml
# - comet.yaml
- csv.yaml
# - mlflow.yaml
+1 -1
View File
@@ -2,7 +2,7 @@
mlflow:
_target_: pytorch_lightning.loggers.mlflow.MLFlowLogger
experiment_name: default
experiment_name: ${name}
tracking_uri: null
tags: null
save_dir: ./mlruns
+1 -1
View File
@@ -6,6 +6,6 @@ neptune:
project_name: your_name/template-tests
close_after_fit: True
offline_mode: False
experiment_name: null
experiment_name: ${name}
experiment_id: null
prefix: ""
+1 -1
View File
@@ -4,7 +4,7 @@ tensorboard:
_target_: pytorch_lightning.loggers.tensorboard.TensorBoardLogger
save_dir: "tensorboard/"
name: "default"
version: null
version: ${name}
log_graph: False
default_hp_metric: True
prefix: ""
+1 -1
View File
@@ -3,7 +3,7 @@
wandb:
_target_: pytorch_lightning.loggers.wandb.WandbLogger
project: "template-tests"
name: null
name: ${name}
save_dir: "."
offline: False # set True to store all logs only locally
id: null # pass correct id to resume experiment!
+15
View File
@@ -0,0 +1,15 @@
# @package _global_
# run in debug mode with:
# `python run.py mode=debug`
# this flag doesn't really do anything
debug: true
# output paths for debug mode
hydra:
run:
dir: logs/debug/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: logs/debug/multirun_${now:%Y-%m-%d_%H-%M-%S}
subdir: ${hydra.job.num}
+11
View File
@@ -0,0 +1,11 @@
# @package _global_
# default running mode
# default output paths for hydra logs
hydra:
run:
dir: logs/runs/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: logs/multiruns/${now:%Y-%m-%d_%H-%M-%S}
subdir: ${hydra.job.num}
+15
View File
@@ -0,0 +1,15 @@
# @package _global_
# run in experiment mode with:
# python run.py mode=exp name='my_new_experiment_23'
# allows for custom naming of the experiment
name: ???
# output paths for experiment mode
hydra:
run:
dir: logs/experiments/${name}
sweep:
dir: logs/experiments/${name}
subdir: ${hydra.job.num}