!6608 fix googlenet gpu for imagenet

Merge pull request !6608 from panfengfeng/fix_googlenet_gpu_for_imagenet
pull/6608/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit aa9fb70f3c

@ -14,10 +14,10 @@
# limitations under the License. # limitations under the License.
# ============================================================================ # ============================================================================
if [ $# -lt 2 ] if [ $# -lt 3 ]
then then
echo "Usage:\n \ echo "Usage: \
sh run_train.sh [DEVICE_NUM] [VISIABLE_DEVICES(0,1,2,3,4,5,6,7)]\n \ sh run_train.sh [DEVICE_NUM] [VISIABLE_DEVICES(0,1,2,3,4,5,6,7)] [cifar10|imagenet]\
" "
exit 1 exit 1
fi fi
@ -42,10 +42,23 @@ cd ../train || exit
export CUDA_VISIBLE_DEVICES="$2" export CUDA_VISIBLE_DEVICES="$2"
dataset_type='cifar10'
if [ $# == 3 ]
then
if [ $3 != "cifar10" ] && [ $3 != "imagenet" ]
then
echo "error: the selected dataset is neither cifar10 nor imagenet"
exit 1
fi
dataset_type=$3
fi
if [ $1 -gt 1 ] if [ $1 -gt 1 ]
then then
mpirun -n $1 --allow-run-as-root --output-filename log_output --merge-stderr-to-stdout \ mpirun -n $1 --allow-run-as-root --output-filename log_output --merge-stderr-to-stdout \
python3 ${BASEPATH}/../train.py > train.log 2>&1 & python3 ${BASEPATH}/../train.py --dataset_name=$dataset_type > train.log 2>&1 &
else else
python3 ${BASEPATH}/../train.py > train.log 2>&1 & python3 ${BASEPATH}/../train.py --dataset_name=$dataset_type > train.log 2>&1 &
fi fi

Loading…
Cancel
Save