NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
SSD v1.2 for TensorFlow1
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
SSD v1.2 for TensorFlow1

With a ResNet-50 backbone and a number of architectural modifications, this version provides better accuracy and performance.

To train your model using mixed precision or TF32 with tensor cores or using TF32, FP32, perform the following steps using the default parameters of the SSD320 v1.2 model on the COCO 2017 dataset.

1. Clone the repository.

git clone https://github.com/NVIDIA/DeepLearningExamples
cd DeepLearningExamples/TensorFlow/Detection/SSD

2. Build the SSD320 v1.2 TensorFlow NGC container.

docker build . -t nvidia_ssd

3. Download and preprocess the dataset.

Extract the COCO 2017 dataset with:

download_all.sh nvidia_ssd <data_dir_path> <checkpoint_dir_path>

Data will be downloaded, preprocessed to tfrecords format and saved in the <data_dir_path> directory (on the host). Moreover the script will download pre-trained RN50 checkpoint in the <checkpoint_dir_path> directory

4. Launch the NGC container to run training/inference.

nvidia-docker run --rm -it --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 -v <data_dir_path>:/data/coco2017_tfrecords -v <checkpoint_dir_path>:/checkpoints --ipc=host nvidia_ssd

5. Start training.

The ./examples directory provides several sample scripts for various GPU settings and act as wrappers around object_detection/model_main.py script. The example scripts can be modified by arguments:

  • A path to directory for checkpoints
  • A path to directory for configs
  • Additional arguments to object_detection/model_main.py

If you want to run 8 GPUs, training with tensor cores acceleration and save checkpoints in /checkpoints directory, run:

bash ./examples/SSD320_FP16_8GPU.sh /checkpoints

6. Start validation/evaluation.

The model_main.py training script automatically runs validation during training. The results from the validation are printed to stdout.

Pycocotools' open-sourced scripts provides a consistent way to evaluate models on the COCO dataset. We are using these scripts during validation to measure models performance in AP metric. Metrics below are evaluated using pycocotools' methodology, in the following format:during validation to measure models performance in AP metric. Metrics below are evaluated using pycocotools' methodology, in the following format:

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.273
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.423
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.291
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.024
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.218
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.451
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.257
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.398
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.427
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.070
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.418
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.645

The metric reported in our results is present in the first row.

To evaluate a checkpointed model saved in the previous step, you can use script from examples directory. If you want to run inference with tensor cores acceleration, run:

bash examples/SSD320_evaluate.sh <path to checkpoint>