-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Łukasz Zalewski
authored
Sep 28, 2021
1 parent
89b502b
commit 86f30fb
Showing
19 changed files
with
131 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,40 @@ | ||
#!/bin/bash | ||
# Run from root folder with: bash bash/setup_conda.sh | ||
|
||
# check if conda is installed | ||
|
||
# Check if conda is installed | ||
if ! command -v conda &> /dev/null | ||
then | ||
echo "The 'conda' command could not be found. Exiting..." | ||
exit | ||
fi | ||
|
||
# This line is needed for enabling conda env activation | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
|
||
# Configure conda env | ||
read -rp "Enter environment name: " env_name | ||
# Configure env | ||
read -rp "Enter conda environment name: " env_name | ||
read -rp "Enter python version (recommended '3.8') " python_version | ||
read -rp "Enter cuda version (recommended '10.2', or 'none' for CPU only): " cuda_version | ||
read -rp "Enter pytorch version (recommended '1.8.1'): " pytorch_version | ||
read -rp "Enter cuda version ('10.2', '11.1' or 'none' for CPU only): " cuda_version | ||
|
||
|
||
# Create conda env | ||
# Create env | ||
conda create -y -n "$env_name" python="$python_version" | ||
conda activate "$env_name" | ||
|
||
# Install pytorch | ||
|
||
# Install pytorch + cuda | ||
if [ "$cuda_version" == "none" ]; then | ||
conda install -y pytorch=$pytorch_version torchvision torchaudio cpuonly -c pytorch | ||
conda install -n "$env_name" -y pytorch torchvision torchaudio cpuonly -c pytorch | ||
elif [ "$cuda_version" == "10.2" ]; then | ||
conda install -n "$env_name" pytorch torchvision torchaudio cudatoolkit=$cuda_version -c pytorch | ||
elif [ "$cuda_version" == "11.1" ]; then | ||
conda install -n "$env_name" pytorch torchvision torchaudio cudatoolkit=$cuda_version -c pytorch -c nvidia | ||
else | ||
conda install -y pytorch=$pytorch_version torchvision torchaudio cudatoolkit=$cuda_version -c pytorch | ||
echo "Incorrect cuda version. Exiting..." | ||
exit | ||
fi | ||
|
||
echo "\n" | ||
echo "To activate this environment, use:" | ||
|
||
# Final message | ||
echo "=======================================" | ||
echo "To activate this environment use:" | ||
echo "conda activate $env_name" | ||
echo "=======================================" | ||
echo -e "\a" |
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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# train with many loggers at once | ||
|
||
defaults: | ||
# - aim.yaml | ||
# - comet.yaml | ||
- csv.yaml | ||
# - mlflow.yaml | ||
|
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 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 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,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} |
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,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} |
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,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} |
Oops, something went wrong.