From 4d0624b628a2ba86005d32a52901e2a2054e8975 Mon Sep 17 00:00:00 2001 From: malin10 Date: Fri, 8 May 2020 14:45:09 +0800 Subject: [PATCH] debug --- fleet_rec/core/trainers/single_trainer.py | 3 +-- fleet_rec/core/trainers/transpiler_trainer.py | 4 +++- models/recall/word2vec/config.yaml | 8 +++----- models/recall/{ => word2vec}/w2v_evaluate_reader.py | 0 models/recall/{ => word2vec}/w2v_reader.py | 0 5 files changed, 7 insertions(+), 8 deletions(-) rename models/recall/{ => word2vec}/w2v_evaluate_reader.py (100%) rename models/recall/{ => word2vec}/w2v_reader.py (100%) diff --git a/fleet_rec/core/trainers/single_trainer.py b/fleet_rec/core/trainers/single_trainer.py index 3a667a3a..772afbf3 100755 --- a/fleet_rec/core/trainers/single_trainer.py +++ b/fleet_rec/core/trainers/single_trainer.py @@ -111,8 +111,7 @@ class SingleTrainer(TranspileTrainer): dataset=dataset, fetch_list=self.fetch_vars, fetch_info=self.fetch_alias, - print_period=1, - debug=True) + print_period=self.fetch_period) self.save(i, "train", is_fleet=False) context['status'] = 'infer_pass' diff --git a/fleet_rec/core/trainers/transpiler_trainer.py b/fleet_rec/core/trainers/transpiler_trainer.py index 73abdc87..4279cbc2 100755 --- a/fleet_rec/core/trainers/transpiler_trainer.py +++ b/fleet_rec/core/trainers/transpiler_trainer.py @@ -40,16 +40,18 @@ class TranspileTrainer(Trainer): if state == "TRAIN": dataloader = self.model._data_loader namespace = "train.reader" + class_name = "TrainReader" else: dataloader = self.model._infer_data_loader namespace = "evaluate.reader" + class_name = "EvaluateReader" batch_size = envs.get_global_env("batch_size", None, namespace) reader_class = envs.get_global_env("class", None, namespace) reader = dataloader_instance.dataloader(reader_class, state, self._config_yaml) - reader_class = envs.lazy_instance_by_fliename(reader_class, "TrainReader") + reader_class = envs.lazy_instance_by_fliename(reader_class, class_name) reader_ins = reader_class(self._config_yaml) if hasattr(reader_ins,'generate_batch_from_trainfiles'): dataloader.set_sample_list_generator(reader) diff --git a/models/recall/word2vec/config.yaml b/models/recall/word2vec/config.yaml index af017b81..a3591e73 100644 --- a/models/recall/word2vec/config.yaml +++ b/models/recall/word2vec/config.yaml @@ -15,7 +15,7 @@ evaluate: workspace: "fleetrec.models.recall.word2vec" reader: batch_size: 50 - class: "{workspace}/../w2v_evaluate_reader.py" + class: "{workspace}/w2v_evaluate_reader.py" test_data_path: "{workspace}/data/test" word_id_dict_path: "{workspace}/data/dict/word_id_dict.txt" @@ -29,16 +29,14 @@ train: reader: batch_size: 100 - class: "{workspace}/../w2v_reader.py" + class: "{workspace}/w2v_reader.py" train_data_path: "{workspace}/data/train" - test_data_path: "{workspace}/data/test" word_count_dict_path: "{workspace}/data/dict/word_count_dict.txt" - word_id_dict_path: "{workspace}/data/dict/word_id_dict.txt" model: models: "{workspace}/model.py" hyper_parameters: - sparse_feature_number: 354051 + sparse_feature_number: 85 sparse_feature_dim: 300 with_shuffle_batch: False neg_num: 5 diff --git a/models/recall/w2v_evaluate_reader.py b/models/recall/word2vec/w2v_evaluate_reader.py similarity index 100% rename from models/recall/w2v_evaluate_reader.py rename to models/recall/word2vec/w2v_evaluate_reader.py diff --git a/models/recall/w2v_reader.py b/models/recall/word2vec/w2v_reader.py similarity index 100% rename from models/recall/w2v_reader.py rename to models/recall/word2vec/w2v_reader.py -- GitLab