I'm looking for an elegant way to load only a small subset of data in detectron2 in order to speed up the training startup for debugging purposes.
I'm building my own instance segmentation model with detectron2 and running it the usual way:
train_net.py --config-file our_training_config.yaml
But it takes several minutes to load everything...
...
[01/25 13:11:48 d2.data.datasets.coco]: Loading datasets/coco/annotations/instances_train2017.json takes 20.74 seconds.
[01/25 13:11:50 d2.data.datasets.coco]: Loaded 118287 images in COCO format from datasets/coco/annotations/instances_train2017.json
...
I was wondering if there is a parameter/trick/flag which allows one to load only a small subset of examples (say, 100) only to quickly see if all the forward and backward calls works. Now it is a bit annoying during the debugging process, since each bug and fix requires another slow run to test if everything works.
Technically one can just cut instances_train2017.json
in size, but I believe that there are some less nasty solutions to this problems.