Commit eaff6662 authored by qianyj's avatar qianyj
Browse files

update TF code

parent 441c8f40
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# 单卡测试 (混合精度) # 单卡测试 (混合精度)
## 运行 ## 运行
export HIP_VISIBLE_DEVICES=0
python3 ./benchmarks-master/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --data_format=NCHW --batch_size=128 --model=resnet50 --optimizer=momentum --variable_update=parameter_server --print_training_accuracy=true --nodistortions --num_gpus=4 --num_epochs=90 --weight_decay=1e-4 --data_dir=$data_dir_path --use_fp16=True --data_name=imagenet --train_dir=$save_checkpoint_path python3 ./benchmarks-master/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --data_format=NCHW --batch_size=128 --model=resnet50 --optimizer=momentum --variable_update=parameter_server --print_training_accuracy=true --nodistortions --num_gpus=4 --num_epochs=90 --weight_decay=1e-4 --data_dir=$data_dir_path --use_fp16=True --data_name=imagenet --train_dir=$save_checkpoint_path
# 多卡测试 (单精度) # 多卡测试 (单精度)
......
...@@ -6,25 +6,25 @@ ...@@ -6,25 +6,25 @@
## 运行 ## 运行
export PYTHONPATH=$PYTHONPATH:/path/to/tensorflow/model export PYTHONPATH=$PYTHONPATH:/path/to/tensorflow/model
export HIP_VISIBLE_DEVICES=0 export HIP_VISIBLE_DEVICES=0
python3 official/vision/image_classification/resnet/resnet_ctl_imagenet_main.py --data_dir=/path/to/{ImageNet-tensorflow_data_dir} --model_dir=/path/to/{model_save_dir} --batch_size=128 --num_gpus=1 --use_synthetic_data=false python3 official/vision/image_classification/resnet/resnet_ctl_imagenet_main.py --data_dir=/path/to/{ImageNet-tensorflow_data_dir} --model_dir=/path/to/{model_save_dir} --batch_size=128 --num_gpus=1 --use_synthetic_data=false
# 单卡测试 (混合精度) # 单卡测试 (混合精度)
## 运行 ## 运行
export PYTHONPATH=$PYTHONPATH:/path/to/tensorflow/model export PYTHONPATH=$PYTHONPATH:/path/to/tensorflow/model
export HIP_VISIBLE_DEVICES=0 export HIP_VISIBLE_DEVICES=0
python3 official/vision/image_classification/resnet/resnet_ctl_imagenet_main.py --data_dir=/path/to/{ImageNet-tensorflow_data_dir} --model_dir=/path/to/{model_save_dir} --batch_size=128 --num_gpus=1 --use_synthetic_data=false --dtype=fp16 python3 official/vision/image_classification/resnet/resnet_ctl_imagenet_main.py --data_dir=/path/to/{ImageNet-tensorflow_data_dir} --model_dir=/path/to/{model_save_dir} --batch_size=128 --num_gpus=1 --use_synthetic_data=false --dtype=fp16
# 多卡测试 (单精度) # 多卡测试 (单精度)
## 运行 ## 运行
mpirun -np $np --hostfile hostfile --bind-to none scripts-run/single_process.sh mpirun -np $np --hostfile hostfile --bind-to none scripts-run/single_process.sh
多卡测试时需要修改部分代码,具体可参考[https://tensorflow.google.cn/guide/migrate/multi_worker_cpu_gpu_training?hl=en] 多卡测试时需要修改部分代码,具体可参考[https://tensorflow.google.cn/guide/migrate/multi_worker_cpu_gpu_training?hl=en]
# 参考 # 参考
[https://github.com/tensorflow/models/tree/v2.7.0](https://github.com/tensorflow/models/tree/v2.7.0/official/vision/image_classification/resnet) [https://github.com/tensorflow/models/tree/v2.7.0](https://github.com/tensorflow/models/tree/v2.7.0/official/vision/image_classification/resnet)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment