From 7e872037d8469b63353e51b59afa8f11a940a8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=9B=BD=E5=BA=86?= <3224925783@qq.com> Date: Mon, 26 Sep 2022 13:05:30 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=90tensorflow=E3=80=91=E3=80=90contrib?= =?UTF-8?q?=E3=80=91=E3=80=90cv=E3=80=91HybridSN=5FID1160=5Ffor=5FTensorFl?= =?UTF-8?q?ow=E7=BD=91=E7=BB=9C=E4=BF=AE=E6=94=B91p=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E8=84=9A=E6=9C=ACfps=E5=8F=96=E5=80=BC=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=20HybridSN=5FID1160=5Ffor=5FTensorFlow?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E4=BF=AE=E6=94=B91p=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E8=84=9A=E6=9C=ACfps=E5=8F=96=E5=80=BC=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9=20=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=E6=80=A7=E8=83=BD=E6=98=BE=E7=A4=BA=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=8E=9F=E5=85=88?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E9=80=BB=E8=BE=91=E4=B8=8D=E9=80=82=E9=85=8D?= =?UTF-8?q?=20=E3=80=90taskid=E3=80=91debug00930105=20debug00930104?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王国庆 <3224925783@qq.com> --- .../test/train_performance_1p.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/TensorFlow/contrib/cv/HybridSN_ID1160_for_TensorFlow/test/train_performance_1p.sh b/TensorFlow/contrib/cv/HybridSN_ID1160_for_TensorFlow/test/train_performance_1p.sh index 6114bf636..e579b894a 100644 --- a/TensorFlow/contrib/cv/HybridSN_ID1160_for_TensorFlow/test/train_performance_1p.sh +++ b/TensorFlow/contrib/cv/HybridSN_ID1160_for_TensorFlow/test/train_performance_1p.sh @@ -133,8 +133,17 @@ e2e_time=$(( $end_time - $start_time )) #结果打印,不需要修改 echo "------------------ Final result ------------------" #输出性能FPS,需要模型审视修改 -TrainingTime=`grep "16238/16238" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk -F '16238/16238' '{print $2}'|grep 'loss:'|awk 'END {print $4}'|cut -d 'm' -f -1` - +#TrainingTime=`grep "16238/16238" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk -F '16238/16238' '{print $2}'|grep 'loss:'|awk 'END {print $4}'|cut -d 'm' -f -1` + +TrainingTime=`grep "16238/16238" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk -F '16238/16238' '{print $2}'|grep 'loss:'|awk 'END {print $4}'|tr -d "a-zA-Z /"` +echo "$TrainingTime" +type=`grep "16238/16238" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk -F '16238/16238' '{print $2}'|grep 'loss:'|awk 'END {print $4}'|awk -F '/' '{print $1}'|sed 's/^[0-9]*//'` +echo "type:$type" +if [ "$type" = "ms" ];then + ActualFPS=`awk 'BEGIN{printf "%.2f\n", '1000'*'${batch_size}'/'${TrainingTime}'}'` +elif [ "$type" = "us" ];then + ActualFPS=`awk 'BEGIN{printf "%.2f\n", '1000000'*'${batch_size}'/'${TrainingTime}'}'` +fi #性能看护结果汇总 #训练用例信息,不需要修改 @@ -144,7 +153,7 @@ CaseName=${Network}_bs${BatchSize}_${RANK_SIZE}'p'_'perf' ##获取性能数据,不需要修改 #吞吐量 -ActualFPS=`awk 'BEGIN{printf "%.2f\n", '1000'*'${batch_size}'/'${TrainingTime}'}'` +#ActualFPS=`awk 'BEGIN{printf "%.2f\n", '1000'*'${batch_size}'/'${TrainingTime}'}'` #获取模型精度 train_accuracy=`grep "16238/16238" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk -F '16238/16238' '{print $2}'|grep 'loss:'|awk 'END {print $10}'` -- Gitee