run_classifier.sh 717 字节
Newer Older
W
wuzewu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
cuda_visible_devices=0
module=resnet50
num_epoch=1
batch_size=16
use_gpu=False
checkpoint_dir=paddlehub_finetune_ckpt

while getopts "gm:n:b:c:d:" options
do
	case "$options" in
        m)
            module=$OPTARG;;
        n)
            num_epoch=$OPTARG;;
        b)
            batch_size=$OPTARG;;
        c)
            checkpoint_dir=$OPTARG;;
        d)
            cuda_visible_devices=$OPTARG;;
        g)
            use_gpu=True;;
		?)
			echo "unknown options"
            exit 1;;
	esac
done

export CUDA_VISIBLE_DEVICES=${cuda_visible_devices}

31
python -u img_classifier.py --use_gpu ${use_gpu} --batch_size ${batch_size} --checkpoint_dir ${checkpoint_dir} --num_epoch ${num_epoch} --module ${module}