From 514d727aa4269646d2361efd28775c0b95f5984c Mon Sep 17 00:00:00 2001 From: xjqbest <173596896@qq.com> Date: Wed, 3 Apr 2019 11:44:54 +0800 Subject: [PATCH] fix dataset bug test=develop --- python/paddle/fluid/dataset.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/paddle/fluid/dataset.py b/python/paddle/fluid/dataset.py index d63773223dd..11ac326e8f7 100644 --- a/python/paddle/fluid/dataset.py +++ b/python/paddle/fluid/dataset.py @@ -240,12 +240,17 @@ class InMemoryDataset(DatasetBase): Args: fleet: fleet singleton. Default None. """ + trainer_id = 0 trainer_num = 1 + fleet_send_batch_size = 80000 if fleet is not None: fleet.fleet_instance.role_maker_._barrier_worker() + trainer_id = fleet.worker_index() trainer_num = fleet.worker_num() self.dataset.register_client2client_msg_handler() + self.dataset.set_trainer_id(trainer_id) self.dataset.set_trainer_num(trainer_num) + self.dataset.set_fleet_send_batch_size(fleet_send_batch_size) if fleet is not None: fleet.fleet_instance.role_maker_._barrier_worker() self.dataset.global_shuffle() -- GitLab