From 3add726da3c30a7af4f1f8680c37f299eb58ca8e Mon Sep 17 00:00:00 2001 From: nagadomi Date: Fri, 22 Jul 2016 19:56:33 +0900 Subject: [PATCH] Fix a bug that the time benchmark does not works when method=user and scale=1 --- tools/benchmark.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/benchmark.lua b/tools/benchmark.lua index 4a60007..da3fb5b 100644 --- a/tools/benchmark.lua +++ b/tools/benchmark.lua @@ -320,9 +320,13 @@ local function benchmark(opt, x, model1, model2) model2_output = image_f(model2, input, opt.crop_size, opt.batch_size) end end + t = sys.clock() model1_output = image_f(model1, input, opt.crop_size, opt.batch_size) + model1_time = model1_time + (sys.clock() - t) if model2 then + t = sys.clock() model2_output = image_f(model2, input, opt.crop_size, opt.batch_size) + model2_time = model2_time + (sys.clock() - t) end end end