667d856a2fc27732d745cd7d926e9739ad12995c,example/ctr/ctr/train.py,,train,#,183
Before Change
elif args.role == "trainer" or args.role == "TRAINER":
logger.info("download the training materials")
file_index = args.trainer_id % 10
address = "https://paddle-ctr-data.bj.bcebos.com/dac" + str(file_index) + ".tar.gz"
cmd = "cd /workspace/ctr/data/ && curl -o dac.tar.gz " + address + " && tar zxf dac.tar.gz && rm dac.tar.gz"
exit_code = subprocess.call(cmd, shell=True)
if exit_code != 0:
raise Exception("The download command failed, please check the network settings")
logger.info("run trainer")
train_prog = t.get_trainer_program()
train_loop(args, train_prog, py_reader, loss, auc_var, batch_auc_var,
args.trainers, args.trainer_id)
After Change
ep_list = args.endpoints.split(",")
args.trainers = int(os.getenv("PADDLE_TRAINERS_NUM", "1"))
args.pserver_id = int(os.getenv("PADDLE_PSERVER_ID", "0"))
for ep in ep_list:
if os.getenv("POD_IP", "localhost") in ep:
args.current_endpoint = ep
break
args.role = os.getenv("TRAINING_ROLE", "TRAINER")
args.trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
args.is_local = bool(int(os.getenv("PADDLE_IS_LOCAL", 0)))
if args.is_local:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: PaddlePaddle/edl
Commit Name: 667d856a2fc27732d745cd7d926e9739ad12995c
Time: 2019-09-28
Author: wangjiawei04@baidu.com
File Name: example/ctr/ctr/train.py
Class Name:
Method Name: train
Project Name: sony/nnabla
Commit Name: 65d4d10a980fa35c383e2a0c583224d5d2ee13b6
Time: 2021-03-30
Author: Yuchi.Wen@sony.com
File Name: python/src/nnabla/core/variable_batch_size.py
Class Name:
Method Name: variable_batch_size
Project Name: scipy/scipy
Commit Name: f30505b836141030f50cdd941f9cbc8f4cda0995
Time: 2016-02-29
Author: pav@iki.fi
File Name: scipy/sparse/linalg/isolve/lgmres.py
Class Name:
Method Name: lgmres