diff --git a/pylauncher.sh b/pylauncher.sh index dcf3f03b69f7b8c21cf749f5b59d778f5d2e3d52..019a4a5d5556ec68b906997b05a2dc142f905c0f 100755 --- a/pylauncher.sh +++ b/pylauncher.sh @@ -3,12 +3,14 @@ if [[ $# -lt 2 ]]; then echo "Usage: $0 environment_name [OPTIONS] command [arg1..argn]" >&2 echo "OPTIONS:" >&2 - echo " -h, --help Show this message" >&2 - echo " -p, --cuda-path Specify the path where cuda is installed (default: /usr/local/cuda-8.0)" >&2 + echo " -h, --help Show this message" >&2 + echo " -p, --cuda-path Specify the path where cuda is installed (default: /usr/local/cuda-10.1)" >&2 + echo " -a, --anaconda-path Specify the path where anaconda is installed (default: /storage/raid1/homedirs/jeremy.auguste/.anaconda3)" >&2 exit 1 fi -cuda_path="/usr/local/cuda-8.0" +cuda_path="/usr/local/cuda-10.1" +anaconda_path="/storage/raid1/homedirs/jeremy.auguste/.anaconda3" while [[ $1 == -* ]]; do case "$1" in @@ -16,11 +18,16 @@ while [[ $1 == -* ]]; do cuda_path="$2" shift 2 ;; + -a|--anaconda-path) + anaconda_path="$2" + shift 2 + ;; -h|--help) echo "Usage: $0 environment_name [OPTIONS] command [arg1..argn]" echo "OPTIONS:" echo " -h, --help Show this message" - echo " -p, --cuda-path Specify the path where cuda is installed (default: /usr/local/cuda-8.0)" + echo " -p, --cuda-path Specify the path where cuda is installed (default: /usr/local/cuda-10.1)" + echo " -a, --anaconda-path Specify the path where anaconda is installed (default: /storage/raid1/homedirs/jeremy.auguste/.anaconda3)" exit 0 ;; *) @@ -35,6 +42,8 @@ done environment="$1" shift 1 +source "$anaconda_path/etc/profile.d/conda.sh" + conda activate $environment if [[ $environment =~ ^keras.* || $environment =~ ^pytorch.* ]]; then