Skip to content

Commit

Permalink
fixes a bug with voc12 training and a path to imagenet weights.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvornikita committed Aug 30, 2017
1 parent 3c74ab5 commit a0403d3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ and install all the requirements listed above.
```
Here, `--run_name` is a required argument that specifies the name of the experiment (needed to restore the weights later in testing and to visualize statistics in Tensorboard), `--dataset` specifies the name of the dataset you want to train on. See the relation between this name and the protobuf dataset files in the 'main' function of training.py. For more information about flags and running options read `config.py`.
During the training you checkpoints will be automatically saved every 1000 iterations in $HOME/archive/BlitzNet300_x4_VOC0712_detseg/ and all the training statistics will be dumped to Tensorboard every 100 iterations.
3. To train on a particular split of VOC12 please specify the flag --dataset=voc12-splitname, where splitname is in [train, val, trainval]. Training on VOC07 operates on both train and val splits by default and is called with a flag --dataset=VOC07.

## Testing a model
1. If your model was successfully trained and you want to evaluate the performance of a particular checkpoint (let's say 65000 - the last one) on VOC07 test and you want visualization of estimated bounding boxes for the first 100 images in the list , you need to run
Expand Down
3 changes: 2 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
parser.add_argument("--ckpt", default=0, type=int)

# The dataset you want to train/test the model on
parser.add_argument("--dataset", default='voc07', choices=['voc07', 'voc12', 'voc07+12',
parser.add_argument("--dataset", default='voc07', choices=['voc07', 'voc12-train', 'voc12-val',
'voc12-trainval', 'voc07+12',
'coco', 'voc07+12-segfull',
'voc07+12-segmentation',
'coco-seg'])
Expand Down
3 changes: 0 additions & 3 deletions paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ def check(dirname):

# Where the imagenet weights are located
INIT_WEIGHTS_DIR = check(os.path.join(EVAL_DIR, 'Weights_imagenet/'))

# Where the logs are dumped
INIT_WEIGHTS_DIR = check(os.path.join(EVAL_DIR, 'Logs/'))
8 changes: 6 additions & 2 deletions training.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,12 @@ def main(argv=None): # pylint: disable=unused-argument

if args.dataset == 'voc07':
dataset = get_dataset('voc07_trainval')
if args.dataset == 'voc12':
dataset = get_dataset('voc12-' + args.split)
if args.dataset == 'voc12-trainval':
dataset = get_dataset('voc12-train-segmentation', 'voc12-val')
if args.dataset == 'voc12-train':
dataset = get_dataset('voc12-train-segmentation')
if args.dataset == 'voc12-val':
dataset = get_dataset('voc12-val-segmentation')
if args.dataset == 'voc07+12':
dataset = get_dataset('voc07_trainval', 'voc12_train', 'voc12_val')
if args.dataset == 'voc07+12-segfull':
Expand Down

0 comments on commit a0403d3

Please sign in to comment.