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 9a1fedcdb056b6b25859b7f56413fa686b589e0d..965365d6d4ccc8b15ee2fdfbd5f20110e2c40581 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" #输出训练精度,需要模型审视修改 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 0ca8ce3f3c7127d1e504b97ae38c5f54d2accdd2..84e59bf421deca88e6ac7339d2a538bb0e9c1668 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 92e345c05eb2de4aee1ee8825083f07e308298a3..0c12e18e5a2f3eaf53bf18d6f9d5ed6724192a45 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