根据模型框架选择对应示例。
root@ubuntu:/data/atlas_dls/public/dataset/resnet50/imagenet_TF# pwd /data/atlas_dls/public/dataset/resnet50/imagenet_TF
root@ubuntu:/data/atlas_dls/public/dataset/resnet50/imagenet_TF# du -sh 42G
/data/atlas_dls/public/code/ResNet50_for_TensorFlow_2.6_code/ ├── scripts │ ├── train_start.sh │ ├── utils.sh │ ├── rank_table.sh │ ... │ ... ├── tensorflow │ ├── resnet_ctl_imagenet_main.py │ ├── resnet_model.py │ ├── resnet_runnable.py │ ... │ ... ├── benchmark.sh ├── modelzoo_level.txt ... └── requirements.txt
... import json import npu_device import os # 添加此行 flags.DEFINE_boolean(name='use_tf_function', default=True, ... ... checkpoint_manager = tf.train.CheckpointManager( runnable.checkpoint, directory=flags_obj.model_dir+"/tf-checkpoint/ckpt-"+os.getenv("RANK_ID"), # 修改该行 max_to_keep=10, step_counter=runnable.global_step, checkpoint_interval=checkpoint_interval) ...
root@ubuntu:/data/atlas_dls/public/dataset/resnet50/imagenet# pwd /data/atlas_dls/public/dataset/resnet50/imagenet
root@ubuntu:/data/atlas_dls/public/dataset/resnet50/imagenet# du -sh 11G
root@ubuntu:/data/atlas_dls/public/code/ResNet50_for_PyTorch_1.5_code/# ResNet50_for_PyTorch_1.5_code/ ├── DistributedResnet50 ├── infer ├── test ├── ... ├── Dockerfile ├── eval.sh ├── python2onx.py ├── pytorch_resnet50_apex.py └── scripts ├── train_start.sh ├── utils.sh └── rank_table.sh
... if [ "${framework}" == "PyTorch" ]; then get_env_for_pytorch_multi_node_job ${DLS_PROGRAM_EXECUTOR} ${boot_file_path}${boot_file} ${train_param} --addr=${MASTER_ADDR} --world-size=${WORLD_SIZE} --rank=${RANK} && tee ${log_url} # 修改此行 check_return_code if [[ $@ =~ need_freeze ]]; then ${DLS_PROGRAM_EXECUTOR} ${boot_file_path}${freeze_cmd} --addr=${MASTER_ADDR} --world-size=${WORLD_SIZE} --rank=${RANK} && tee ${log_url} check_return_code fi ...
root@ubuntu:/data/atlas_dls/public/dataset/imagenet# pwd /data/atlas_dls/public/dataset/imagenet
root@ubuntu:/data/atlas_dls/public/dataset/imagenet# du -sh 11G
root@ubuntu:/data/atlas_dls/public/code/ResNet50_for_MindSpore_1.9_code/scripts/# scripts/ ├── docker_start.sh ├── run_standalone_train_gpu.sh ├── run_standalone_train.sh ... ├── rank_table.sh ├── utils.sh └── train_start.sh