From cf180c1f077ffd012e7a176645666fb0973dfb0e Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Tue, 18 Aug 2020 17:22:44 +0800 Subject: [PATCH] fix training hang in PaddleCloud single machine. (#1233) --- tools/train.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/train.py b/tools/train.py index 828f54818..7f058c528 100644 --- a/tools/train.py +++ b/tools/train.py @@ -53,7 +53,9 @@ logger = logging.getLogger(__name__) def main(): env = os.environ - FLAGS.dist = 'PADDLE_TRAINER_ID' in env and 'PADDLE_TRAINERS_NUM' in env + FLAGS.dist = 'PADDLE_TRAINER_ID' in env \ + and 'PADDLE_TRAINERS_NUM' in env \ + and int(env['PADDLE_TRAINERS_NUM']) > 1 if FLAGS.dist: trainer_id = int(env['PADDLE_TRAINER_ID']) local_seed = (99 + trainer_id) -- GitLab