首先测试widerface_test,因为test数据集比val小。
修改数据集,选择测试test:
出现问题:
1.CUDA out of time:
搜寻无果,冒险和demo.py一样,在test_widerface()首行加入了:torch.set_grad_enabled(False) ,结果这个报错没有了。
torch.set_grad_enabled(False)
2.TypeError: can't convert cuda:0 device type tensor to numpy.:
与demo.py出现类似问题,还在寻找方案。
解决方案是和demo.py一样,在widerface_val中修改:
while detections[0,i,j,0] >= 0.01:
score = detections[0,i,j,0]
score = score.cpu().numpy() #修改
pt = (detections[0, i, j, 1:]*scale).cpu().numpy()
不报错了。