From 3162664ad7d0aceaa2a9fcb7f89825a2dff83cf2 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Wed, 29 May 2019 10:24:43 +0800 Subject: [PATCH] fix some problem --- PaddleRec/ctr/dataset/cluster_train.sh | 8 ++++---- PaddleRec/ctr/dataset/ctr_dataset_reader.py | 2 +- PaddleRec/ctr/dataset/train_dataset.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PaddleRec/ctr/dataset/cluster_train.sh b/PaddleRec/ctr/dataset/cluster_train.sh index 9a994a45..00dd1b68 100644 --- a/PaddleRec/ctr/dataset/cluster_train.sh +++ b/PaddleRec/ctr/dataset/cluster_train.sh @@ -1,7 +1,7 @@ #!/bin/bash # start pserver0 -python train.py \ +python train_dataset.py \ --train_data_path /paddle/data/train.txt \ --is_local 0 \ --role pserver \ @@ -11,7 +11,7 @@ python train.py \ > pserver0.log 2>&1 & # start pserver1 -python train.py \ +python train_dataset.py \ --train_data_path /paddle/data/train.txt \ --is_local 0 \ --role pserver \ @@ -21,7 +21,7 @@ python train.py \ > pserver1.log 2>&1 & # start trainer0 -python train.py \ +python train_dataset.py \ --train_data_path /paddle/data/train.txt \ --is_local 0 \ --role trainer \ @@ -31,7 +31,7 @@ python train.py \ > trainer0.log 2>&1 & # start trainer1 -python train.py \ +python train_dataset.py \ --train_data_path /paddle/data/train.txt \ --is_local 0 \ --role trainer \ diff --git a/PaddleRec/ctr/dataset/ctr_dataset_reader.py b/PaddleRec/ctr/dataset/ctr_dataset_reader.py index 6ea31771..dc75406c 100644 --- a/PaddleRec/ctr/dataset/ctr_dataset_reader.py +++ b/PaddleRec/ctr/dataset/ctr_dataset_reader.py @@ -60,7 +60,7 @@ class CriteoDataset(data_generator.MultiSlotDataGenerator): dense_feature.append((float(features[idx]) - self.cont_min_[idx - 1]) / self.cont_diff_[idx - 1]) ret_result.append(("dense_feature", dense_feature)) for idx in self.categorical_range_: - ret_result.append((str(idx - 13), [hash(str(idx) + features[idx]) % self.hash_dim_])) + ret_result.append(("C" + str(idx - 13), [hash(str(idx) + features[idx]) % self.hash_dim_])) ret_result.append(("label", [int(features[0])])) yield tuple(ret_result) diff --git a/PaddleRec/ctr/dataset/train_dataset.py b/PaddleRec/ctr/dataset/train_dataset.py index da49ffe4..22605736 100644 --- a/PaddleRec/ctr/dataset/train_dataset.py +++ b/PaddleRec/ctr/dataset/train_dataset.py @@ -213,7 +213,7 @@ def train(args): dataset.set_batch_size(128) dataset.set_use_var(words) pipe_command = 'python ctr_dataset_reader.py %d %d %d %d' \ - % args.sparse_feature_dim, args.trainer_id, 1, args.trainer_num + % (args.sparse_feature_dim, args.trainer_id, 1, args.trainers) dataset.set_pipe_command(pipe_command) dataset.set_filelist(filelist) -- GitLab