From a524f8e6d6988b995d8f84fa7b51b416d8f12480 Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Thu, 14 Dec 2017 18:46:24 +0800 Subject: [PATCH] auto compute the training FPS by avg elapsed time --- benchmark/paddle/image/run_mkldnn_train.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/benchmark/paddle/image/run_mkldnn_train.sh b/benchmark/paddle/image/run_mkldnn_train.sh index 320206239a..5335af5ac1 100755 --- a/benchmark/paddle/image/run_mkldnn_train.sh +++ b/benchmark/paddle/image/run_mkldnn_train.sh @@ -28,6 +28,10 @@ function train() { --test_period=100 \ --config_args=$args \ 2>&1 | tee ${log} + + avg_time=`tail ${log} -n 1 | awk -F ' ' '{print $8}' | sed 's/avg=//'` + fps=`awk 'BEGIN{printf "%.2f",('$bs' / '$avg_time' * 1000)}'` + echo "FPS: $fps images/sec" 2>&1 | tee -a ${log} } if [ ! -f "train.list" ]; then -- GitLab