11. SSD model training
The train and test datasets including labels in csv format can be downloaded from this link:
In the top-level folder (that is, Chapter 11, Object Detection), create the dataset folder, copy the downloaded file there, and extract it by running:
mkdir dataset
cp drinks.tar.gz dataset
cd dataset
tar zxvf drinks.tar.gz
cd..
The SSD model is trained for 200 epochs by executing:
python3 ssd-11.6.1.py --train
The default batch size, --batch-size=4
, can be adjusted depending on the GPU memory. On 1080Ti, the batch size is 2. On 32GB V100, this could be 4 or 8 per GPU. --train
represents model training option.
To support normalization of bounding box offsets, the --normalize
option is included. To use improved loss functions, the --improved_loss
option is added. If only smooth L1 is desired (no focal loss), use –smooth-l1
. To illustrate:
- L1, no normalization:
python3 ssd-11.1.1.py...