run_multi.sh 595 字节
Newer Older
D
dangqingqing 已提交
1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash
set -e

function test() {
  cfg=$1
  batch=$2
  prefix=$3
  batch_per_gpu=`expr ${batch} / 4`
  sed -i "/input: \"data\"/{n;s/^input_dim.*/input_dim: ${batch_per_gpu}/g}" $cfg 
  sed -i "/input: \"label\"/{n;s/^input_dim.*/input_dim: ${batch_per_gpu}/g}" $cfg 
  sed -i "1c\net : \"${cfg}\"" solver.prototxt
12
  caffe train --solver=solver.prototxt -gpu 0,1,2,3 > logs/${prefix}-4gpu-batch${batch}.log 2>&1
D
dangqingqing 已提交
13 14 15 16 17 18 19 20 21 22 23 24
}

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

# alexnet
test alexnet.prototxt 512 alexnet 
test alexnet.prototxt 1024 alexnet 

# googlnet 
test googlenet.prototxt 512 googlenet