faster rcnn 训练
./experiments/scripts/faster_rcnn_alt_opt.sh 0 ZF pascal_voc
#!/bin/bash
# Usage:
# ./experiments/scripts/faster_rcnn_alt_opt.sh GPU NET DATASET [options args to {train,test}_net.py]
# DATASET is only pascal_voc for now
#
# Example:
# ./experiments/scripts/faster_rcnn_alt_opt.sh 0 VGG_CNN_M_1024 pascal_voc \
# --set EXP_DIR foobar RNG_SEED 42 TRAIN.SCALES "[400, 500, 600, 700]"
set -x
set -e
export PYTHONUNBUFFERED="True"
GPU_ID=$1
NET=$2
NET_lc=${NET,,}
DATASET=$3
array=( $@ )
len=${#array[@]}
EXTRA_ARGS=${array[@]:3:$len}
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_}
case $DATASET in
pascal_voc)
TRAIN_IMDB="voc_2007_trainval"
TEST_IMDB="voc_2007_test"
PT_DIR="pascal_voc"
ITERS=40000
;;
coco)
echo "Not implemented: use experiments/scripts/faster_rcnn_end2end.sh for coco"
exit
;;
*)
echo "No dataset given"
exit
;;
esac
LOG="experiments/logs/faster_rcnn_alt_opt_${NET}_${EXTRA_ARGS_SLUG}.txt.`date +'%Y-%m-%d_%H-%M-%S'`"
exec &> >(tee -a "$LOG")
echo Logging output to "$LOG"
time ./tools/train_faster_rcnn_alt_opt.py --gpu ${GPU_ID} \
--net_name ${NET} \
--weights data/imagenet_models/${NET}.v2.caffemodel \
--imdb ${TRAIN_IMDB} \
--cfg experiments/cfgs/faster_rcnn_alt_opt.yml \
${EXTRA_ARGS}
set +x
NET_FINAL=`grep "Final model:" ${LOG} | awk '{print $3}'`
set -x
time ./tools/test_net.py --gpu ${GPU_ID} \
--def models/${PT_DIR}/${NET}/faster_rcnn_alt_opt/faster_rcnn_test.pt \
--net ${NET_FINAL} \
--imdb ${TEST_IMDB} \
--cfg experiments/cfgs/faster_rcnn_alt_opt.yml \
${EXTRA_ARGS}
Reading annotation for 4801/4952
Reading annotation for 4901/4952
Saving cached annotations to /home//py-faster-rcnn/data/VOCdevkit2007/annotations_cache/annots.pkl
AP for aeroplane = 0.6104
AP for bicycle = 0.7060
AP for bird = 0.5401
AP for boat = 0.4113
AP for bottle = 0.3118
AP for bus = 0.6708
AP for car = 0.7407
AP for cat = 0.7074
AP for chair = 0.3632
AP for cow = 0.6420
AP for diningtable = 0.6072
AP for dog = 0.6806
AP for horse = 0.7654
AP for motorbike = 0.6794
AP for person = 0.6553
AP for pottedplant = 0.3238
AP for sheep = 0.5597
AP for sofa = 0.5185
AP for train = 0.6880
AP for tvmonitor = 0.6110
Mean AP = 0.5896
~~~~~~~~
Results:
0.610
0.706
0.540
0.411
0.312
0.671
0.741
0.707
0.363
0.642
0.607
0.681
0.765
0.679
0.655
0.324
0.560
0.518
0.688
0.611
0.590
~~~~~~~~
--------------------------------------------------------------
Results computed with the **unofficial** Python eval code.
Results should be very close to the official MATLAB eval code.
Recompute with `./tools/reval.py --matlab ...` for your paper.
-- Thanks, The Management
--------------------------------------------------------------
real 2m44.858s
user 2m41.012s
sys 0m18.440s
:~/py-faster-rcnn$
测试
./tools/demo.py --net zf