#!/bin/bash

# modify these augments if you want to try other datasets, splits or methods
# dataset: ['pascal', 'cityscapes', 'ade20k', 'coco']
# method: ['unimatch_v2', 'fixmatch', 'supervised']
# exp: just for specifying the 'save_path'
# split: ['92', '1_16', ...]. Please check directory './splits/$dataset' for concrete splits


dataset='mydata'
method='unimatch_v2'
exp='semi_supervised_run'
split='001'

#config=../configs/${dataset}.yaml
config=/dataset/UniMatch-V2/configs/semisup/my_semi.yaml
#labeled_id_path=/dataset/splits/mydata/001/labeled.txt
#unlabeled_id_path=/dataset/splits/mydata/001/unlabeled.txt
labeled_id_path=/dataset/labeled.txt
unlabeled_id_path=/dataset/unlabeled.txt
#save_path=exp/$dataset/$method/$exp/$split
save_path=/dataset/UniMatch-V2/exp/$dataset/$method/$exp/$split

mkdir -p $save_path

CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.launch \
    --nproc_per_node=$1 \
    --master_addr=localhost \
    --master_port=$2 \
    ./unimatch_v2.py \
    --config=$config --labeled-id-path $labeled_id_path --unlabeled-id-path $unlabeled_id_path \
    --save-path $save_path --port $2 2>&1 | tee $save_path/out.log

