Ultra-Fast-Lane-Detection-v2
Ultra-Fast-Lane-Detection-v2 copied to clipboard
测试速度与论文相差过大
测试机器的GPU是1080Ti
我尝试测试模型速度,略微修改了speed_simple.py
文件:
import torch
import time
import numpy as np
from utils.common import get_model, merge_config
torch.backends.cudnn.benchmark = True
args, cfg = merge_config()
net = get_model(cfg)
net.eval()
x = torch.ones((1,3,cfg.train_height,cfg.train_width)).cuda()
for i in range(1000):#change
y = net(x)
t_all = []
for i in range(500): #change
t1 = time.time()
y = net(x)
t2 = time.time()
t_all.append(t2 - t1)
print('average time:', np.mean(t_all) / 1)
print('average fps:',1 / np.mean(t_all))
print('fastest time:', min(t_all) / 1)
print('fastest fps:',1 / min(t_all))
print('slowest time:', max(t_all) / 1)
print('slowest fps:',1 / max(t_all))
运行:python speed_simple.py configs/tusimple_res18.py
,结果只有240fps。与论文中的结果差异过大
@578223592 如我们在文章中所说的,速度是在3090上测的