File size: 850 Bytes
3f29a93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/bash

set -v

eval "$(conda shell.bash hook)"
conda activate monai

homedir="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

BUNDLE="$(cd "$homedir/.." && pwd)"

echo "Bundle root: $BUNDLE"

export PYTHONPATH="$BUNDLE"

# set this to something else to use different numbered GPUs on your system
export CUDA_VISIBLE_DEVICES="0,1"

# seems to resolve some multiprocessing issues with certain libraries
export OMP_NUM_THREADS=1

CKPT=none

# need to change this if you have multiple nodes or not 2 GPUs
PYTHON="torchrun --standalone --nnodes=1 --nproc_per_node=2"

CONFIG="['$BUNDLE/configs/train.yaml','$BUNDLE/configs/multi_gpu_train.yaml']"

$PYTHON -m monai.bundle run \
    --meta_file $BUNDLE/configs/metadata.json \
    --logging_file $BUNDLE/configs/logging.conf \
    --config_file "$CONFIG" \
    --bundle_root $BUNDLE \
    $@