sithu31296/semantic-segmentation

benchmark.py script suggests adding synchronization locks

LiuPengJX opened this issue · 0 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!