torch.cuda.max_memory_allocated()
的最大值作为 GPU 占用率,同时设置 torch.backends.cudnn.benchmark=False
。nvidia-smi
显示的要少tools/benchmark.py
来获取推理时间,它在 torch.backends.cudnn.benchmark=False
的设定下,计算 200 张图片的平均推理时间slide
模式(滑动模式):测试的配置文件字段 test_cfg
会是 dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
.crop_size
和 stride
决定,重合区域会进行平均whole
模式 (全图模式):测试的配置文件字段 test_cfg
会是 dict(mode='whole')
. 在这个模式下,全图会被直接输入到网络中进行推理。slide
进行推理,其余模型用 whole
进行推理align_corners=True
。其余情况,对于输入大小为 8x (比如 512,1024),我们使用 align_corners=False
请参考 FCN for details.
请参考 PSPNet for details.
请参考 DeepLabV3 for details.
请参考 PSANet for details.
请参考 DeepLabV3+ for details.
请参考 UPerNet for details.
请参考 NonLocal Net for details.
请参考 EncNet for details.
请参考 CCNet for details.
请参考 DANet for details.
请参考 APCNet for details.
请参考 HRNet for details.
请参考 GCNet for details.
请参考 DMNet for details.
请参考 ANN for details.
请参考 OCRNet for details.
请参考 Fast-SCNN for details.
请参考 ResNeSt for details.
请参考 Semantic FPN for details.
请参考 PointRend for details.
请参考 MobileNetV2 for details.
请参考 MobileNetV3 for details.
请参考 EMANet for details.
请参考 DNLNet for details.
请参考 CGNet for details.
请参考 Mixed Precision (FP16) Training 在 BiSeNetV2 训练的样例 for details.
为了公平比较,我们全部使用 ResNet-101V1c 进行标定。输入大小为 1024x512,批量样本数为 2。
训练速度如下表,指标为每次迭代的时间,以秒为单位,越低越快。
Implementation | PSPNet (s/iter) | DeepLabV3+ (s/iter) |
---|---|---|
MMSegmentation | 0.83 | 0.85 |
SegmenTron | 0.84 | 0.85 |
CASILVision | 1.15 | N/A |
vedaseg | 0.95 | 1.25 |
注意:DeepLabV3+ 的输出步长为 8