# 介绍 该测试用例可用于ResNet50等网络的性能测试及精度验证。 # 单卡测试(单精度) ## 运行 export PYTHONPATH=/path/to/tensorflow/model:$PYTHONPATH 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 # 单卡测试 (混合精度) ## 运行 export PYTHONPATH=/path/to/tensorflow/model:$PYTHONPATH 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 # 多卡测试 (单精度) ## 运行 export PYTHONPATH=/path/to/tensorflow/model:$PYTHONPATH mpirun -np $np --hostfile hostfile --bind-to none scripts-run/single_process.sh 多卡测试时需要修改部分代码,具体可参考[multi-worker](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)