create_module.sh 659 字节
Newer Older
W
wuzewu 已提交
1 2 3 4 5 6
#!/bin/bash
set -o nounset
set -o errexit

model_name="ResNet50"

W
wuzewu 已提交
7
while getopts "m:" options
W
wuzewu 已提交
8 9 10 11 12 13 14 15 16 17
do
	case "$options" in
        m)
            model_name=$OPTARG;;
		?)
			echo "unknown options"
            exit 1;;
	esac
done

W
wuzewu 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
script_path=$(cd `dirname $0`; pwd)
module_path=hub_module_${model_name}

if [ -d $script_path/$module_path ]
then
    echo "$module_path already existed!"
    exit 0
fi

cd $script_path/resources/

if [ ! -d ${model_name}_pretrained ]
then
    sh download.sh $model_name
fi

cd $script_path/

W
wuzewu 已提交
36
python create_module.py --pretrained_model=resources/${model_name}_pretrained --model ${model_name}
W
wuzewu 已提交
37 38

echo "Successfully create $module_path"