2019-01-31 15:27:38 +01:00
|
|
|
#!/usr/bin/env sh
|
2019-03-30 06:38:15 +01:00
|
|
|
if [ "$#" -ne 3 ] ;then
|
2019-01-31 15:27:38 +01:00
|
|
|
echo "Input illegal number of parameters " $#
|
2019-03-30 06:38:15 +01:00
|
|
|
echo "Need 3 parameters for the architecture, and the channel and the layers"
|
2019-01-31 15:27:38 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ "$TORCH_HOME" = "" ]; then
|
|
|
|
echo "Must set TORCH_HOME envoriment variable for data dir saving"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "TORCH_HOME : $TORCH_HOME"
|
|
|
|
fi
|
|
|
|
|
2019-03-30 06:38:15 +01:00
|
|
|
arch=$1
|
2019-01-31 15:27:38 +01:00
|
|
|
dataset=imagenet
|
2019-03-30 06:38:15 +01:00
|
|
|
channels=$2
|
|
|
|
layers=$3
|
|
|
|
SAVED=./output/NAS-CNN/${arch}-${dataset}-C${channels}-L${layers}-E250
|
2019-01-31 15:27:38 +01:00
|
|
|
|
2019-03-30 06:38:15 +01:00
|
|
|
PY_C="./env/bin/python"
|
|
|
|
|
|
|
|
if [ ! -f ${PY_C} ]; then
|
|
|
|
echo "Local Run with Python: "`which python`
|
|
|
|
PY_C="python"
|
|
|
|
else
|
|
|
|
echo "Cluster Run with Python: "${PY_C}
|
2019-03-31 16:49:43 +02:00
|
|
|
echo "Unzip ILSVRC2012"
|
2019-04-01 15:12:50 +02:00
|
|
|
tar --version
|
|
|
|
#tar xf ./hadoop-data/ILSVRC2012.tar -C ${TORCH_HOME}
|
2019-04-02 08:58:25 +02:00
|
|
|
#${PY_C} ./data/decompress.py ./hadoop-data/ILSVRC2012-TAR ./data/data/ILSVRC2012 tar > ./data/data/get_imagenet.sh
|
|
|
|
${PY_C} ./data/decompress.py ./hadoop-data/ILSVRC2012-ZIP ./data/data/ILSVRC2012 zip > ./data/data/get_imagenet.sh
|
|
|
|
bash ./data/data/get_imagenet.sh
|
2019-04-01 15:12:50 +02:00
|
|
|
echo "Unzip ILSVRC2012 done"
|
2019-03-30 06:38:15 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
${PY_C} --version
|
|
|
|
|
|
|
|
${PY_C} ./exps-cnn/train_base.py \
|
2019-01-31 15:27:38 +01:00
|
|
|
--data_path $TORCH_HOME/ILSVRC2012 \
|
|
|
|
--dataset ${dataset} --arch ${arch} \
|
|
|
|
--save_path ${SAVED} \
|
|
|
|
--grad_clip 5 \
|
|
|
|
--init_channels ${channels} --layers ${layers} \
|
|
|
|
--model_config ./configs/nas-imagenet.config \
|
|
|
|
--print_freq 200 --workers 20
|