run.sh 790 字节
Newer Older
D
dangqingqing 已提交
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
set -e

function test() {
  cfg=$1
  batch=$2
  prefix=$3
  sed -i "/input: \"data\"/{n;s/^input_dim.*/input_dim: $batch/g}" $cfg 
  sed -i "/input: \"label\"/{n;s/^input_dim.*/input_dim: $batch/g}" $cfg
  caffe time --model=$cfg --iterations=50 --gpu 0 > logs/$prefix-1gpu-batch${batch}.log 2>&1
}

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

# alexnet
test alexnet.prototxt 64 alexnet 
test alexnet.prototxt 128 alexnet 
test alexnet.prototxt 256 alexnet 
test alexnet.prototxt 512 alexnet 

# googlenet
test googlenet.prototxt 64 googlenet 
test googlenet.prototxt 128 googlenet 

# small net 
test smallnet_mnist_cifar.prototxt 64 smallnet 
test smallnet_mnist_cifar.prototxt 128 smallnet 
test smallnet_mnist_cifar.prototxt 256 smallnet 
test smallnet_mnist_cifar.prototxt 512 smallnet