forked from rbgirshick/py-faster-rcnn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script, solvers, and model definitions for end-to-end training of Fas…
…ter R-CNN detectors
- Loading branch information
1 parent
81ee227
commit f740544
Showing
10 changed files
with
3,184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
# Usage: | ||
# ./experiments/scripts/default_faster_rcnn.sh GPU NET [--set ...] | ||
# Example: | ||
# ./experiments/scripts/default_faster_rcnn.sh 0 ZF \ | ||
# --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,,} | ||
ITERS=70000 | ||
DATASET_TRAIN=voc_2007_trainval | ||
DATASET_TEST=voc_2007_test | ||
|
||
array=( $@ ) | ||
len=${#array[@]} | ||
EXTRA_ARGS=${array[@]:2:$len} | ||
EXTRA_ARGS_SLUG=${EXTRA_ARGS// /_} | ||
|
||
LOG="experiments/logs/faster_rcnn_${NET}_${EXTRA_ARGS_SLUG}.txt.`date +'%Y-%m-%d_%H-%M-%S'`" | ||
exec &> >(tee -a "$LOG") | ||
echo Logging output to "$LOG" | ||
|
||
NET_INIT=data/imagenet_models/${NET}.v2.caffemodel | ||
|
||
time ./tools/train_net.py --gpu ${GPU_ID} \ | ||
--solver models/${NET}/faster_rcnn_end2end/solver.prototxt \ | ||
--weights ${NET_INIT} \ | ||
--imdb ${DATASET_TRAIN} \ | ||
--iters ${ITERS} \ | ||
--cfg experiments/cfgs/faster_rcnn_end2end.yml \ | ||
${EXTRA_ARGS} | ||
|
||
set +x | ||
NET_FINAL=`grep -B 1 "done solving" ${LOG} | grep "Wrote snapshot" | awk '{print $4}'` | ||
set -x | ||
|
||
time ./tools/test_net.py --gpu ${GPU_ID} \ | ||
--def models/${NET}/faster_rcnn_end2end/test.prototxt \ | ||
--net ${NET_FINAL} \ | ||
--imdb ${DATASET_TEST} \ | ||
--cfg experiments/cfgs/faster_rcnn_end2end.yml \ | ||
${EXTRA_ARGS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
train_net: "models/VGG16/faster_rcnn_end2end/train.prototxt" | ||
base_lr: 0.001 | ||
lr_policy: "step" | ||
gamma: 0.1 | ||
stepsize: 50000 | ||
display: 20 | ||
average_loss: 100 | ||
# iter_size: 1 | ||
momentum: 0.9 | ||
weight_decay: 0.0005 | ||
# We disable standard caffe solver snapshotting and implement our own snapshot | ||
# function | ||
snapshot: 0 | ||
# We still use the snapshot prefix, though | ||
snapshot_prefix: "vgg16_faster_rcnn" | ||
iter_size: 2 |
Oops, something went wrong.