Skip to content

Instantly share code, notes, and snippets.

@jeffdonahue
Created February 13, 2017 22:27
Show Gist options
  • Save jeffdonahue/886510bdf9f9666a68331c980a877b2b to your computer and use it in GitHub Desktop.
Save jeffdonahue/886510bdf9f9666a68331c980a877b2b to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
set -e
export LD_LIBRARY_PATH='/usr/local/cuda/lib64/'
export PYTHONUNBUFFERED="True"
NAME="scratch"
NAME="/tmp/magic_caffenet.caffenet"
if [ "$#" -ge 1 ]; then
NAME=${2}
fi
if [ "$#" -ge 2 ]; then
INIT=${3}
fi
LOG="experiments/logs/${NAME}_caffenet.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
exec &> >(tee -a "$LOG" | mailtail -n 28 -s "$NAME")
echo Logging output to "$LOG"
time ./tools/train_net.py --gpu $1 \
--solver models/CaffeNet/solver2.prototxt \
--weights ${INIT} \
--imdb voc_2007_trainval \
--iters 150000 \
--cfg experiments/cfgs/multiscale.yml\
--set TRAIN.SNAPSHOT_INFIX $NAME
CAFFEMODEL=$(ls -t output/multiscale/voc_2007_trainval/caffenet_fast_rcnn_${NAME}_iter*.caffemodel | head -n1)
time ./tools/test_net.py --gpu $1 \
--def models/CaffeNet/test.prototxt \
--net ${CAFFEMODEL} \
--imdb voc_2007_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment