run_multi.sh 483 字节
Newer Older
C
chengduoZH 已提交
1 2
#!/bin/bash

D
dangqingqing 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
set -e

function test() {
  cfg=$1
  num_gpu=$2
  batch_size=$3
  batch_per_gpu=`expr ${batch_size} / ${num_gpu}`
  prefix=$4
  python $cfg --num_gpus=$num_gpu --batch_size=${batch_per_gpu} > logs/${prefix}-4gpu-${batch_size}.log 2>&1
}

if [ ! -d "logs" ]; then
  mkdir logs
fi

# alexnet
test alexnet_multi_gpu.py 4 512 alexnet
test alexnet_multi_gpu.py 4 1024 alexnet

# googlenet 
test googlenet_multi_gpu.py 4 512 alexnet
test googlenet_multi_gpu.py 4 1024 alexnet