Imported from https://github.com/yhenon/pytorch-retinanet