2022-12-16 19:52:44 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#SBATCH -J DeepRain
|
|
|
|
#SBATCH -N 1
|
|
|
|
#SBATCH -n 14
|
|
|
|
#SBATCH --gres=gpu:1
|
|
|
|
#SBATCH -o %j.%N.%a.segment-mono.out.log
|
|
|
|
#SBATCH -e %j.%N.%a.segment-mono.err.log
|
|
|
|
#SBATCH -p gpu05,gpu
|
|
|
|
#SBATCH --time=5-00:00:00
|
|
|
|
#SBATCH --mem=30000
|
|
|
|
# ---> in MiB
|
|
|
|
|
|
|
|
module load utilities/multi
|
|
|
|
module load readline/7.0
|
|
|
|
module load gcc/10.2.0
|
|
|
|
module load cuda/11.5.0
|
|
|
|
|
|
|
|
module load python/anaconda/4.6/miniconda/3.7
|
|
|
|
|
|
|
|
|
|
|
|
show_help() {
|
|
|
|
echo -e "Trains a TEST DeepLabv3+ model using rainfall radar and water depth data." >&2;
|
|
|
|
echo -e "" >&2;
|
|
|
|
echo -e "Usage:" >&2;
|
|
|
|
echo -e " sbatch slurm-TEST-deeplabv3p-rainfall.job" >&2;
|
|
|
|
echo -e "" >&2;
|
|
|
|
echo -e "....where:" >&2;
|
|
|
|
echo -e " IMAGE_SIZE=128 Optional. Sets the size of the 'images' that the DeepLabV3+ model will work with." >&2;
|
|
|
|
echo -e " BATCH_SIZE=64 Optional. Sets the batch size to train the model with." >&2;
|
2023-01-05 17:08:57 +00:00
|
|
|
echo -e " DIR_RAINFALLWATER The path to the directory the .tfrecord files containing the rainfall radar / water depth data." >&2;
|
2022-12-16 19:52:44 +00:00
|
|
|
echo -e " PATH_HEIGHTMAP The path to the heightmap jsonl file to read in." >&2;
|
|
|
|
echo -e " PATH_COLOURMAP The path to the colourmap for predictive purposes." >&2;
|
|
|
|
echo -e " STEPS_PER_EPOCH The number of steps to consider an epoch. Defaults to None, which means use the entire dataset." >&2;
|
|
|
|
echo -e " POSTFIX Postfix to append to the output dir (auto calculated)." >&2;
|
|
|
|
echo -e " ARGS Optional. Any additional arguments to pass to the python program." >&2;
|
|
|
|
echo -e "" >&2;
|
|
|
|
echo -e "It is strongly advised that all filepaths do NOT contain spaces." >&2;
|
|
|
|
echo -e "" >&2;
|
|
|
|
echo -e "The code used to identify the run is taken automatically from the filename of the config file." >&2;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2023-01-05 17:08:57 +00:00
|
|
|
DIR_RAINFALLWATER="${DIR_RAINFALLWATER:-$HOME/rainfallwater_records_tfrecord}";
|
2022-12-16 19:52:44 +00:00
|
|
|
PATH_HEIGHTMAP="${PATH_HEIGHTMAP:-$HOME/data/terrain50-nimrodsized.json.gz}";
|
|
|
|
PATH_COLOURMAP="${PATH_COLOURMAP:-$HOME/instance-level-human-parsing/instance-level_human_parsing/human_colormap.mat}";
|
|
|
|
|
|
|
|
CODE="train_mono";
|
|
|
|
|
|
|
|
if [[ -n "${POSTFIX}" ]]; then
|
|
|
|
echo -e ">>> Applying postfix of ${POSTFIX}" >&2;
|
|
|
|
CODE="${CODE}_${POSTFIX}";
|
|
|
|
fi
|
|
|
|
|
2023-01-05 17:08:57 +00:00
|
|
|
DIR_OUTPUT="output/$(date -u --rfc-3339=date)_${CODE}";
|
2022-12-16 19:52:44 +00:00
|
|
|
|
|
|
|
echo -e ">>> Additional args: ${ARGS}";
|
|
|
|
|
|
|
|
export PATH=$HOME/software/bin:$PATH;
|
2023-01-05 17:42:20 +00:00
|
|
|
export IMAGE_SIZE BATCH_SIZE DIR_RAINFALLWATER PATH_HEIGHTMAP PATH_COLOURMAP STEPS_PER_EPOCH DIR_OUTPUT;
|
2022-12-16 19:52:44 +00:00
|
|
|
|
|
|
|
echo ">>> Installing requirements";
|
|
|
|
conda run -n py38 pip install -r requirements.txt;
|
|
|
|
echo ">>> Training model";
|
|
|
|
#shellcheck disable=SC2086
|
2023-01-05 17:08:57 +00:00
|
|
|
/usr/bin/env time -v conda run -n py38 src/deeplabv3_plus_test_rainfall.py
|
2022-12-16 19:52:44 +00:00
|
|
|
echo ">>> exited with code $?";
|