#!/bin/bash
experiment_name="biggan"
weights_path=""
device_id=0
for para in $*
do
if [[ $para == --device_id* ]];then
device_id=`echo ${para#*=}`
elif [[ $para == --weights_path* ]];then
weights_path=`echo ${para#*=}`
fi
done
if [[ weights_path == "" ]];then
echo "[Error] para \"weights_path\" must be config"
exit 1
fi
if [ $ASCEND_DEVICE_ID ];then
echo "device id is ${ASCEND_DEVICE_ID}"
elif [ ${device_id} ];then
export ASCEND_DEVICE_ID=${device_id}
echo "device id is ${ASCEND_DEVICE_ID}"
else
"[Error] device id must be config"
exit 1
fi
cur_path=`pwd`
cur_path_last_dirname=${cur_path##*/}
if [ x"${cur_path_last_dirname}" == x"test" ];then
test_path_dir=${cur_path}
cd ..
cur_path=`pwd`
else
test_path_dir=${cur_path}/test
fi
check_etp_flag=`env | grep etp_running_flag`
etp_flag=`echo ${check_etp_flag#*=}`
if [ x"${etp_flag}" != x"true" ];then
source ${test_path_dir}/env_npu.sh
fi
echo ${weights_path}
python3 -u evaluation.py \
--weights_path ${weights_path} \
--G_attn 64 --D_attn 64 \
--G_nl inplace_relu --D_nl inplace_relu \
--SN_eps 1e-6 --BN_eps 1e-5 --adam_eps 1e-6 \
--G_ortho 0.0 \
--G_shared \
--G_init ortho --D_init ortho \
--hier --dim_z 120 --shared_dim 128 \
--G_eval_mode \
--G_ch 96 --D_ch 96 \
--seed 0 \
--device='npu' \
--resume \
--gpu ${device_id} \
--use_fp16 \
--opt_level O2