#!/bin/bash
# run by: bash scripts/submit_work.sh $pid
# set pid first
pid=$1
echo wait for $pid
num=`ps -aux | grep $pid | grep python | wc -l`
while [[ $num > 0 ]]; do
    #echo wait for $pid
    sleep 1
    num=`ps -aux | grep $pid | grep python | wc -l`
done
sleep 2
# when $pid finished, run these 
#PORT=29504 CUDA_VISIBLE_DEVICES=0,1,2,3 tools/dist_train.sh configs/distillers/mimic_fpn/mfpn_trainH3_mask_rcnn_swinS_fpn_3x_distill_mask_rcnn_swinT_fpn_1x_coco.py 4
#PORT=29502 CUDA_VISIBLE_DEVICES=4,5,6,7 tools/dist_train.sh configs/pascal_voc/faster_rcnn_r101_fpn_1x_voc0712.py 4
PORT=29502 tools/dist_train.sh configs/distillers/mimic_backbone/mb_faster_rcnn_r152_fpn_1x_distill_faster_rcnn_r50_fpn_1x_coco.py 8