modify alexnet script shell

This commit is contained in:
wukesong 2020-10-19 17:24:06 +08:00
parent 4500df104e
commit af2b0c046c
5 changed files with 14 additions and 14 deletions

View File

@ -110,7 +110,7 @@ Major parameters in train.py and config.py as follows:
- running on Ascend - running on Ascend
``` ```
python train.py --data_path cifar-10-batches-bin --ckpt_path ckpt > log.txt 2>&1 & python train.py --data_path cifar-10-batches-bin --ckpt_path ckpt > log 2>&1 &
# or enter script dir, and run the script # or enter script dir, and run the script
sh run_standalone_train_ascend.sh cifar-10-batches-bin ckpt sh run_standalone_train_ascend.sh cifar-10-batches-bin ckpt
``` ```
@ -118,7 +118,7 @@ Major parameters in train.py and config.py as follows:
After training, the loss value will be achieved as follows: After training, the loss value will be achieved as follows:
``` ```
# grep "loss is " train.log # grep "loss is " log
epoch: 1 step: 1, loss is 2.2791853 epoch: 1 step: 1, loss is 2.2791853
... ...
epoch: 1 step: 1536, loss is 1.9366643 epoch: 1 step: 1536, loss is 1.9366643
@ -132,7 +132,7 @@ Major parameters in train.py and config.py as follows:
- running on GPU - running on GPU
``` ```
python train.py --device_target "GPU" --data_path cifar-10-batches-bin --ckpt_path ckpt > log.txt 2>&1 & python train.py --device_target "GPU" --data_path cifar-10-batches-bin --ckpt_path ckpt > log 2>&1 &
# or enter script dir, and run the script # or enter script dir, and run the script
sh run_standalone_train_for_gpu.sh cifar-10-batches-bin ckpt sh run_standalone_train_for_gpu.sh cifar-10-batches-bin ckpt
``` ```
@ -140,7 +140,7 @@ Major parameters in train.py and config.py as follows:
After training, the loss value will be achieved as follows: After training, the loss value will be achieved as follows:
``` ```
# grep "loss is " train.log # grep "loss is " log
epoch: 1 step: 1, loss is 2.3125906 epoch: 1 step: 1, loss is 2.3125906
... ...
epoch: 30 step: 1560, loss is 0.6687547 epoch: 30 step: 1560, loss is 0.6687547
@ -158,30 +158,30 @@ Before running the command below, please check the checkpoint path used for eval
- running on Ascend - running on Ascend
``` ```
python eval.py --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-1_1562.ckpt > log.txt 2>&1 & python eval.py --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-1_1562.ckpt > eval_log.txt 2>&1 &
# or enter script dir, and run the script # or enter script dir, and run the script
sh run_standalone_eval_ascend.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-1_1562.ckpt sh run_standalone_eval_ascend.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-1_1562.ckpt
``` ```
You can view the results through the file "log.txt". The accuracy of the test dataset will be as follows: You can view the results through the file "eval_log". The accuracy of the test dataset will be as follows:
``` ```
# grep "Accuracy: " log.txt # grep "Accuracy: " eval_log
'Accuracy': 0.8832 'Accuracy': 0.8832
``` ```
- running on GPU - running on GPU
``` ```
python eval.py --device_target "GPU" --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-30_1562.ckpt > log.txt 2>&1 & python eval.py --device_target "GPU" --data_path cifar-10-verify-bin --ckpt_path ckpt/checkpoint_alexnet-30_1562.ckpt > eval_log 2>&1 &
# or enter script dir, and run the script # or enter script dir, and run the script
sh run_standalone_eval_for_gpu.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-30_1562.ckpt sh run_standalone_eval_for_gpu.sh cifar-10-verify-bin ckpt/checkpoint_alexnet-30_1562.ckpt
``` ```
You can view the results through the file "log.txt". The accuracy of the test dataset will be as follows: You can view the results through the file "eval_log". The accuracy of the test dataset will be as follows:
``` ```
# grep "Accuracy: " log.txt # grep "Accuracy: " eval_log
'Accuracy': 0.88512 'Accuracy': 0.88512
``` ```

View File

@ -26,4 +26,4 @@ export CKPT_PATH=$3
export DEVICE_ID=$4 export DEVICE_ID=$4
python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \ python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 & --device_id=$DEVICE_ID --device_target="Ascend" > eval_log 2>&1 &

View File

@ -26,4 +26,4 @@ export CKPT_PATH=$3
export DEVICE_ID=$4 export DEVICE_ID=$4
python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \ python eval.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH --ckpt_path=$CKPT_PATH \
--device_id=$DEVICE_ID --device_target="GPU" > log.txt 2>&1 & --device_id=$DEVICE_ID --device_target="GPU" > eval_log 2>&1 &

View File

@ -25,4 +25,4 @@ export DATA_PATH=$2
export DEVICE_ID=$3 export DEVICE_ID=$3
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \ python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
--device_id=$DEVICE_ID --device_target="Ascend" > log.txt 2>&1 & --device_id=$DEVICE_ID --device_target="Ascend" > log 2>&1 &

View File

@ -25,4 +25,4 @@ export DATA_PATH=$2
export DEVICE_ID=$3 export DEVICE_ID=$3
python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \ python train.py --dataset_name=$DATASET_NAME --data_path=$DATA_PATH \
--device_id=$DEVICE_ID --device_target="GPU" > log.txt 2>&1 & --device_id=$DEVICE_ID --device_target="GPU" > log 2>&1 &