diff --git a/models/multitask/ple/net.py b/models/multitask/ple/net.py index e36d624a9..2490b7695 100644 --- a/models/multitask/ple/net.py +++ b/models/multitask/ple/net.py @@ -179,7 +179,7 @@ def forward(self, input_data): # task-specific expert part for i in range(0, self.task_num): for j in range(0, self.exp_per_task): - linear_out = self._param_expert[i * self.task_num + j]( + linear_out = self._param_expert[i * self.exp_per_task + j]( input_data[i]) expert_output = F.relu(linear_out) expert_outputs.append(expert_output) diff --git a/tools/utils/static_ps/reader_helper.py b/tools/utils/static_ps/reader_helper.py index 73b0c0540..310b08463 100755 --- a/tools/utils/static_ps/reader_helper.py +++ b/tools/utils/static_ps/reader_helper.py @@ -73,7 +73,7 @@ def get_infer_reader(input_var, config): def get_file_list(data_path, config): assert os.path.exists(data_path) - file_list = [data_path + "/%s" % x for x in os.listdir(data_path)] + file_list = [data_path + "/%s" % x for x in sorted(os.listdir(data_path))] if config.get("runner.split_file_list"): logger.info("Split file list for worker {}".format(fleet.worker_index( )))