#!/bin/bash
 
export MIOPEN_DEBUG_DISABLE_FIND_DB=1
export MIOPEN_USER_DB_PATH=/tmp/tensorflow-object
HOME_DIR=
WORK_DIR=`pwd`
which python3
echo "TF_GPU_THREAD_COUNT=4"
index=`date +%Y-%m-%d-%H-%M-%S`
PIPELINE_CONFIG_PATH=${WORK_DIR}/models/research/object_detection/samples/configs/faster_rcnn_inception_v2_coco.config
NUM_CLONES=1
PS_TASKS=0
CPKT_PATH=${WORK_DIR}/faster_rcnn_inception_v2_coco_${NUM_CLONES}dcu
mkdir ${CPKT_PATH}
echo ${CPKT_PATH}
start=$(date +%s)
 
numactl --cpunodebind=0,1,2,3 --membind=0,1,2,3 python3 ${WORK_DIR}/models/research/object_detection/legacy/train.py --pipeline_config_path=${PIPELINE_CONFIG_PATH} --train_dir=${CPKT_PATH} --num_clones=${NUM_CLONES} --ps_tasks=${PS_TASKS} --alsologtostderr
 
end=$(date +%s)
echo "10000 step cost time is " $(($end - $start))
