sithu31296 / semantic-segmentation

SOTA Semantic Segmentation Models in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

benchmark.py script suggests adding synchronization locks

LiuPengJX opened this issue · comments

benchmark.py
It is recommended to add a synchronization lock for calculating fps. The code is as follows:
torch.cuda.synchronize()
tic = time.perf_counter()
model(inputs)
torch.cuda.synchronize()
toc = time.perf_counter()
total_time += toc - tic

thank you!