VITA-Group / FasterSeg

[ICLR 2020] "FasterSeg: Searching for Faster Real-time Semantic Segmentation" by Wuyang Chen, Xinyu Gong, Xianming Liu, Qian Zhang, Yuan Li, Zhangyang Wang
MIT License
526 stars 107 forks source link

Latency issue #18

Closed kim2002037 closed 4 years ago

kim2002037 commented 4 years ago

Thank you for your great job. I have one question about latency issue.

When I checked your code, I found that you use bilinear interpolation in train/operations.py

but, In the test part you used nearest interpolation in latency/operations.py.

Can you tell me why? (I'm asking you this question because nearest interpolation is faster than bilinear interpolation in pytorch)

you use as below in train/operations.py out = F.interpolate(x, size=(int(x.size(2))//2, int(x.size(3))//2), mode='bilinear', align_corners=True) out = F.interpolate(out, size=(int(x.size(2)), int(x.size(3))), mode='bilinear', align_corners=True)

you use as below in latency/operations.py out = F.interpolate(x, size=(int(x.size(2))//2, int(x.size(3))//2), mode='nearest') out = F.interpolate(out, size=(int(x.size(2)), int(x.size(3))), mode='nearest')

chenwydj commented 4 years ago

Hi @kim2002037 ! Thank you for your interest!

This is because TensorRT (v5.1.5) does not support bilinear interpolation. We cannot get the latency of the model uses bilinear interpolation.

Meanwhile, in PyTorch we have the following FPS measurements:

The FPS gap is only 5.2, which is very small considering the FPS gap (on TensorRT) in our Table 4 (our 163.9 v.s. 136.9 of the 2nd runner-up).

kim2002037 commented 4 years ago

Thank you for the quick and friendly response.