unify gen_wts.py and inference.cpp dummy test value. (#457)

Reviewed by: @L1aoXingyu
pull/468/head
Darren 2021-04-19 09:23:15 +07:00 committed by GitHub
parent 8276ccf4fd
commit 37ccd3683d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -95,13 +95,13 @@ if __name__ == '__main__':
model.eval()
if args.verify:
input = torch.ones(1, 3, cfg.INPUT.SIZE_TEST[0], cfg.INPUT.SIZE_TEST[1]).to(cfg.MODEL.DEVICE)
input = torch.ones(1, 3, cfg.INPUT.SIZE_TEST[0], cfg.INPUT.SIZE_TEST[1]).to(cfg.MODEL.DEVICE) * 255.
out = model(input).view(-1).cpu().detach().numpy()
print('[Model output]: \n', out)
if args.benchmark:
start_time = time.time()
input = torch.ones(1, 3, cfg.INPUT.SIZE_TEST[0], cfg.INPUT.SIZE_TEST[1]).to(cfg.MODEL.DEVICE)
input = torch.ones(1, 3, cfg.INPUT.SIZE_TEST[0], cfg.INPUT.SIZE_TEST[1]).to(cfg.MODEL.DEVICE) * 255.
for i in range(100):
out = model(input).view(-1).cpu().detach()
print("--- %s seconds ---" % ((time.time() - start_time)/100.) )