From 10240357556ccfbdcb034699a16395b0a9cb9932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=92=99=E5=A5=87?= <9953698+wang-mengqi22@user.noreply.gitee.com> Date: Thu, 24 Mar 2022 11:07:28 +0000 Subject: [PATCH 1/5] image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh. --- .../ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh b/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh index eb9b1d165d..7592b22dd1 100644 --- a/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh +++ b/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh @@ -66,6 +66,7 @@ nohup python3 main.py --dataset_name OpenImages \ --weight_decay 5.00E-04 \ --override_cache True \ --workers 4 \ + --metadata_root $data_path/metadata/ \ --data_root $data_path \ --mask_root $data_path \ --box_v2_metric True \ -- Gitee From eaea1de6cf1eae5a4fd4ebaf21f79843c0a5f2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=92=99=E5=A5=87?= <9953698+wang-mengqi22@user.noreply.gitee.com> Date: Thu, 24 Mar 2022 12:09:51 +0000 Subject: [PATCH 2/5] update PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh. --- .../tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh b/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh index 3ddbf7af03..edc75b4069 100644 --- a/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh +++ b/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh @@ -123,7 +123,7 @@ do #let c=b*$cpustep-1 #执行训练脚本,以下传参不需要修改,其他需要模型审视修改 - nohup python3 train.py -m Tacotron2 -o ${cur_path}/output --amp -lr $learning_rate --epochs $train_epochs -bs $batch_size --device $ASCEND_DEVICE_ID --dataset-path $data_path --weight-decay 1e-6 --grad-clip-thresh 1.0 --cudnn-enabled --log-file nvlog.json --anneal-steps 500 1000 1500 --anneal-factor 0.1 > ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log 2>&1 & + nohup python3 train.py -m Tacotron2 -o ${cur_path}/output --amp -lr $learning_rate --epochs $train_epochs -bs $batch_size --device $ASCEND_DEVICE_ID --dataset-path $data_path --training-files $data_path/filelists --weight-decay 1e-6 --grad-clip-thresh 1.0 --cudnn-enabled --log-file nvlog.json --anneal-steps 500 1000 1500 --anneal-factor 0.1 > ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log 2>&1 & done wait -- Gitee From 9acf5e08efcc95b609863d9235dd3bd7a0519cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=92=99=E5=A5=87?= <9953698+wang-mengqi22@user.noreply.gitee.com> Date: Mon, 28 Mar 2022 01:21:55 +0000 Subject: [PATCH 3/5] update PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh. --- .../tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh b/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh index edc75b4069..e1fa0fb2ed 100644 --- a/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh +++ b/PyTorch/dev/audio/tacotron2_ID0406_for_PyTorch/test/train_performance_1p.sh @@ -123,7 +123,7 @@ do #let c=b*$cpustep-1 #执行训练脚本,以下传参不需要修改,其他需要模型审视修改 - nohup python3 train.py -m Tacotron2 -o ${cur_path}/output --amp -lr $learning_rate --epochs $train_epochs -bs $batch_size --device $ASCEND_DEVICE_ID --dataset-path $data_path --training-files $data_path/filelists --weight-decay 1e-6 --grad-clip-thresh 1.0 --cudnn-enabled --log-file nvlog.json --anneal-steps 500 1000 1500 --anneal-factor 0.1 > ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log 2>&1 & + nohup python3 train.py -m Tacotron2 -o ${cur_path}/output --amp -lr $learning_rate --epochs $train_epochs -bs $batch_size --device $ASCEND_DEVICE_ID --dataset-path $data_path --training-files $data_path/filelists/ljs_audio_text_train_filelist.txt --validation-files $data_path/filelists/ljs_audio_text_val_filelist.txt --weight-decay 1e-6 --grad-clip-thresh 1.0 --cudnn-enabled --log-file nvlog.json --anneal-steps 500 1000 1500 --anneal-factor 0.1 > ${cur_path}/output/${ASCEND_DEVICE_ID}/train_${ASCEND_DEVICE_ID}.log 2>&1 & done wait -- Gitee From dd0907de89add772ffa7677f601a309e4897f58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=92=99=E5=A5=87?= <9953698+wang-mengqi22@user.noreply.gitee.com> Date: Mon, 28 Mar 2022 06:23:23 +0000 Subject: [PATCH 4/5] update PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh. --- .../ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh b/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh index 7592b22dd1..de6c1c3033 100644 --- a/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh +++ b/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh @@ -67,6 +67,7 @@ nohup python3 main.py --dataset_name OpenImages \ --override_cache True \ --workers 4 \ --metadata_root $data_path/metadata/ \ + --metadata_root $data_path/metadata/ \ --data_root $data_path \ --mask_root $data_path \ --box_v2_metric True \ -- Gitee From cd6d9f04a0620680ff67e5e8406aeba2be9d7503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=92=99=E5=A5=87?= <9953698+wang-mengqi22@user.noreply.gitee.com> Date: Mon, 28 Mar 2022 07:23:52 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20PyTo?= =?UTF-8?q?rch/dev/cv/image=5Fclassification/ADLayer=5FID1087=5Ffor=5FPyTo?= =?UTF-8?q?rch/test/train=5Fperformance=5F1p.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/train_performance_1p.sh | 127 ------------------ 1 file changed, 127 deletions(-) delete mode 100644 PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh diff --git a/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh b/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh deleted file mode 100644 index de6c1c3033..0000000000 --- a/PyTorch/dev/cv/image_classification/ADLayer_ID1087_for_PyTorch/test/train_performance_1p.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash - -cur_path=`pwd`/../ -#失败用例打屏 -export ASCEND_SLOG_PRINT_TO_STDOUT=0 - -#基础参数,需要模型审视修改 -#Batch Size -batch_size=32 -#网络名称,同目录名称 -Network="ADLayer_ID1087_for_PyTorch" -#Device数量,单卡默认为1 -RANK_SIZE=1 -#训练epoch,可选 -train_epochs= -#训练step -train_steps= -#学习率 -learning_rate=1e-3 - -#参数配置 -data_path="" - -if [[ $1 == --help || $1 == --h ]];then - echo "usage:./train_performance_1p.sh " - exit 1 -fi - -for para in $* -do - if [[ $para == --data_path* ]];then - data_path=`echo ${para#*=}` - fi -done - -if [[ $data_path == "" ]];then - echo "[Error] para \"data_path\" must be config" - exit 1 -fi -##############执行训练########## -cd $cur_path -if [ -d $cur_path/test/output ];then - rm -rf $cur_path/test/output/* - mkdir -p $cur_path/test/output/$ASCEND_DEVICE_ID -else - mkdir -p $cur_path/test/output/$ASCEND_DEVICE_ID -fi -wait - -#sed -i "s|omniglot/omniglot|$data_path/omniglot|g" ${cur_path}/omniglot_train.py - -export NPU_CALCULATE_DEVICE=$ASCEND_DEVICE_ID -cp $data_path/vgg16-397923af.pth /root/.cache/torch/checkpoints/ -start=$(date +%s) -nohup python3 main.py --dataset_name OpenImages \ - --architecture vgg16 \ - --wsol_method cam \ - --experiment_name OpenImages_vgg16_CAM \ - --pretrained TRUE \ - --num_val_sample_per_class 5 \ - --large_feature_map FALSE \ - --batch_size 32 \ - --epochs 1 \ - --lr 0.00227913316 \ - --lr_decay_frequency 3 \ - --weight_decay 5.00E-04 \ - --override_cache True \ - --workers 4 \ - --metadata_root $data_path/metadata/ \ - --metadata_root $data_path/metadata/ \ - --data_root $data_path \ - --mask_root $data_path \ - --box_v2_metric True \ - --iou_threshold_list 30 50 70 \ - --eval_checkpoint_type last > $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log 2>&1 & -wait -end=$(date +%s) -e2e_time=$(( $end - $start )) - - -#结果打印,不需要修改 -echo "------------------ Final result ------------------" -#输出性能FPS,需要模型审视修改 -TrainingTime=`cat $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|grep "FPS"|awk -F " " '{print $1}'|awk -F ":" '{print $2}'|awk '{sum+=$1} END {print"",sum/NR}'|sed s/[[:space:]]//g` -FPS=`grep FPS $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|awk -F "FPS:" '{print$2}' | awk '{sum+=$1} END {print"",sum/NR}'` - -#打印,不需要修改 -echo "Final Performance images/sec : $FPS" - -#输出训练精度,需要模型审视修改 -#打印,不需要修改 -#echo "Final Train Accuracy : ${train_accuracy}" -echo "E2E Training Duration sec : $e2e_time" - -#性能看护结果汇总 -#训练用例信息,不需要修改 -BatchSize=${batch_size} -DeviceType=`uname -m` -CaseName=${Network}_bs${BatchSize}_${RANK_SIZE}'p'_'perf' - -##获取性能数据,不需要修改 -#吞吐量 -ActualFPS=${FPS} - -#从train_$ASCEND_DEVICE_ID.log提取Loss到train_${CaseName}_loss.txt中,需要根据模型审视 - -grep "current value" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log|grep "metric loss"|awk -F ":" '{print $2}'|sed s/[[:space:]]//g > $cur_path/test/output/$ASCEND_DEVICE_ID/train_${CaseName}_loss.txt - -#精度值 -#train_accuracy=`grep "loss" $cur_path/test/output/$ASCEND_DEVICE_ID/train_${CaseName}_loss_2.txt|awk -F " " '{print $8}'|awk 'END {print}'` -train_accuracy=`grep "Split val, metric classification, best value" $cur_path/test/output/$ASCEND_DEVICE_ID/train_$ASCEND_DEVICE_ID.log |awk -F "value: " '{print$2}'|awk 'BEGIN {max = 0} {if ($1+0 > max+0) max=$1} END {print max}'` - -#最后一个迭代loss值,不需要修改 -ActualLoss=`awk 'END {print}' $cur_path/test/output/$ASCEND_DEVICE_ID/train_${CaseName}_loss.txt` - -#关键信息打印到${CaseName}.log中,不需要修改 -echo "Network = ${Network}" > $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "RankSize = ${RANK_SIZE}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "BatchSize = ${BatchSize}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "DeviceType = ${DeviceType}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "CaseName = ${CaseName}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "ActualFPS = ${ActualFPS}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "TrainingTime = ${TrainingTime}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -#echo "TrainAccuracy = ${train_accuracy}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "ActualLoss = ${ActualLoss}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log -echo "E2ETrainingTime = ${e2e_time}" >> $cur_path/test/output/$ASCEND_DEVICE_ID/${CaseName}.log - -- Gitee