From 75cae6c8646d60cce291b3a1135f9f525eeb758c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=8E=89=E6=9D=BE?= Date: Thu, 31 Mar 2022 01:15:17 +0000 Subject: [PATCH 1/3] update ID0645 --- .../test/train_performance_1p.sh | 6 ++++-- .../Shufflenet_ID0645_for_TensorFlow/train.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh index 0ca8ce3f3..08a955669 100644 --- a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh +++ b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh @@ -89,9 +89,11 @@ CaseName=${Network}_bs${BatchSize}_${RankSize}'p'_'perf' #结果打印,不需要修改 echo "------------------ Final result ------------------" #输出性能FPS,需要模型审视修改 -steps_sec=`grep "time:" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk 'END{print $10}'|awk -F, '{print $1}'` +#steps_sec=`grep "time:" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk 'END{print $10}'|awk -F, '{print $1}'` #打印,不需要修改 -FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'*'${train_steps}'/'${steps_sec}')}'` +#FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'*'${train_steps}'/'${steps_sec}')}'` +steps_sec=`grep step_time $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F'step_time' 'END{print $2}'` +FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'/'${steps_sec}')}'` echo "Final Performance images/sec : $FPS" #输出训练精度,需要模型审视修改 diff --git a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/train.py b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/train.py index 92e345c05..0c12e18e5 100644 --- a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/train.py +++ b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/train.py @@ -218,10 +218,11 @@ def train(): # main training loop for step in training_steps: - + mystarttime = time.time() _, batch_loss, batch_accuracy = sess.run([ ops['optimize'], ops['log_loss'], ops['accuracy'] ]) + print('----------step_time',time.time()-mystarttime) running_loss += batch_loss running_accuracy += batch_accuracy -- Gitee From 2e9feebeacf1650e7a11bb65ccec3ea5bba2646d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=8E=89=E6=9D=BE?= Date: Thu, 31 Mar 2022 06:59:52 +0000 Subject: [PATCH 2/3] update ID0645 --- .../Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh index 9a1fedcdb..05f951d3b 100644 --- a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh +++ b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh @@ -89,9 +89,11 @@ CaseName=${Network}_bs${BatchSize}_${RankSize}'p'_'perf' #结果打印,不需要修改 echo "------------------ Final result ------------------" #输出性能FPS,需要模型审视修改 -steps_sec=`grep "time:" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk 'END{print $10}'|awk -F, '{print $1}'` +#steps_sec=`grep "time:" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk 'END{print $10}'|awk -F, '{print $1}'` #打印,不需要修改 -FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'*'${train_steps}'/'${steps_sec}')}'` +#FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'*'${train_steps}'/'${steps_sec}')}'` +steps_sec=`grep step_time $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F'step_time' 'END{print $2}'` +FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'/'${steps_sec}')}'` echo "Final Performance images/sec : $FPS" #输出训练精度,需要模型审视修改 -- Gitee From 30ab60e3a46548d2617b3f15c2b555e44e34e6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=8E=89=E6=9D=BE?= Date: Thu, 31 Mar 2022 07:19:13 +0000 Subject: [PATCH 3/3] update ID0645 --- .../Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh | 2 +- .../test/train_performance_1p.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh index 05f951d3b..965365d6d 100644 --- a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh +++ b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_full_1p.sh @@ -92,7 +92,7 @@ echo "------------------ Final result ------------------" #steps_sec=`grep "time:" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk 'END{print $10}'|awk -F, '{print $1}'` #打印,不需要修改 #FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'*'${train_steps}'/'${steps_sec}')}'` -steps_sec=`grep step_time $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F'step_time' 'END{print $2}'` +steps_sec=`grep step_time $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F'step_time ' 'END{print $2}'` FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'/'${steps_sec}')}'` echo "Final Performance images/sec : $FPS" diff --git a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh index 08a955669..84e59bf42 100644 --- a/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh +++ b/TensorFlow/built-in/cv/image_classification/Shufflenet_ID0645_for_TensorFlow/test/train_performance_1p.sh @@ -92,7 +92,7 @@ echo "------------------ Final result ------------------" #steps_sec=`grep "time:" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk 'END{print $10}'|awk -F, '{print $1}'` #打印,不需要修改 #FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'*'${train_steps}'/'${steps_sec}')}'` -steps_sec=`grep step_time $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F'step_time' 'END{print $2}'` +steps_sec=`grep step_time $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log | awk -F'step_time ' 'END{print $2}'` FPS=`awk 'BEGIN{printf("%.2f\n",'${batch_size}'/'${steps_sec}')}'` echo "Final Performance images/sec : $FPS" -- Gitee