Skip to content

Commit

Permalink
[ADD] helpers bash scripts to run the models
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCretois committed Feb 1, 2024
1 parent b57ba81 commit b4a6fc0
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
17 changes: 17 additions & 0 deletions shell_scripts/train_baseline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
cd ..

BASE_FOLDER=$1
CONFIG_PATH="/app/CONFIG.yaml"

# Check if BASE_FOLDER is not set or empty
if [ -z "$BASE_FOLDER" ]; then
echo "Error: BASE_FOLDER is not specified."
exit 1
fi

docker run -v $BASE_FOLDER:/data -v $PWD:/app --gpus all beats poetry run prototypicalbeats/trainer.py fit \
--config $CONFIG_PATH \
--model.model_type baseline \
--model.state train \
--trainer.default_root_dir "/data/lightning_logs/baseline"
12 changes: 12 additions & 0 deletions shell_scripts/train_beats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

BASE_FOLDER=$1
CONFIG_PATH="/app/CONFIG.yaml"

# Check if BASE_FOLDER is not set or empty
if [ -z "$BASE_FOLDER" ]; then
echo "Error: BASE_FOLDER is not specified."
exit 1
fi

docker run -v $BASE_FOLDER:/data -v $PWD:/app --gpus all beats poetry run prototypicalbeats/trainer.py fit --config $CONFIG_PATH
18 changes: 18 additions & 0 deletions shell_scripts/train_pann.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
cd ..

BASE_FOLDER=$1
CONFIG_PATH="/app/CONFIG.yaml"

# Check if BASE_FOLDER is not set or empty
if [ -z "$BASE_FOLDER" ]; then
echo "Error: BASE_FOLDER is not specified."
exit 1
fi

docker run -v $BASE_FOLDER:/data -v $PWD:/app --gpus all beats poetry run prototypicalbeats/trainer.py fit \
--config $CONFIG_PATH \
--model.model_type pann \
--model.state train \
--model.model_path "/data/models/PANN/Cnn14_mAP=0.431.pth" \
--trainer.default_root_dir "/data/lightning_logs/pann"
15 changes: 15 additions & 0 deletions shell_scripts/validate_beats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

BASE_DIR=$1

cd ..

docker run -v $BASE_DIR:/data -v $PWD:/app \
--gpus all \
beats \
poetry run python /app/evaluate/evaluateDCASE.py \
--config "/app/CONFIG_PREDICT.yaml" \
--overwrite
#data.status="validate" \
#model.model_type="beats" \
#model.model_path="/data/lightning_logs/BEATs/lightning_logs/version_2/checkpoints/epoch=99-step=10000.ckpt"

0 comments on commit b4a6fc0

Please sign in to comment.