提交 4d0624b6 编写于 作者: M malin10

debug

上级 05b1b890
...@@ -111,8 +111,7 @@ class SingleTrainer(TranspileTrainer): ...@@ -111,8 +111,7 @@ class SingleTrainer(TranspileTrainer):
dataset=dataset, dataset=dataset,
fetch_list=self.fetch_vars, fetch_list=self.fetch_vars,
fetch_info=self.fetch_alias, fetch_info=self.fetch_alias,
print_period=1, print_period=self.fetch_period)
debug=True)
self.save(i, "train", is_fleet=False) self.save(i, "train", is_fleet=False)
context['status'] = 'infer_pass' context['status'] = 'infer_pass'
......
...@@ -40,16 +40,18 @@ class TranspileTrainer(Trainer): ...@@ -40,16 +40,18 @@ class TranspileTrainer(Trainer):
if state == "TRAIN": if state == "TRAIN":
dataloader = self.model._data_loader dataloader = self.model._data_loader
namespace = "train.reader" namespace = "train.reader"
class_name = "TrainReader"
else: else:
dataloader = self.model._infer_data_loader dataloader = self.model._infer_data_loader
namespace = "evaluate.reader" namespace = "evaluate.reader"
class_name = "EvaluateReader"
batch_size = envs.get_global_env("batch_size", None, namespace) batch_size = envs.get_global_env("batch_size", None, namespace)
reader_class = envs.get_global_env("class", None, namespace) reader_class = envs.get_global_env("class", None, namespace)
reader = dataloader_instance.dataloader(reader_class, state, self._config_yaml) 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) reader_ins = reader_class(self._config_yaml)
if hasattr(reader_ins,'generate_batch_from_trainfiles'): if hasattr(reader_ins,'generate_batch_from_trainfiles'):
dataloader.set_sample_list_generator(reader) dataloader.set_sample_list_generator(reader)
......
...@@ -15,7 +15,7 @@ evaluate: ...@@ -15,7 +15,7 @@ evaluate:
workspace: "fleetrec.models.recall.word2vec" workspace: "fleetrec.models.recall.word2vec"
reader: reader:
batch_size: 50 batch_size: 50
class: "{workspace}/../w2v_evaluate_reader.py" class: "{workspace}/w2v_evaluate_reader.py"
test_data_path: "{workspace}/data/test" test_data_path: "{workspace}/data/test"
word_id_dict_path: "{workspace}/data/dict/word_id_dict.txt" word_id_dict_path: "{workspace}/data/dict/word_id_dict.txt"
...@@ -29,16 +29,14 @@ train: ...@@ -29,16 +29,14 @@ train:
reader: reader:
batch_size: 100 batch_size: 100
class: "{workspace}/../w2v_reader.py" class: "{workspace}/w2v_reader.py"
train_data_path: "{workspace}/data/train" train_data_path: "{workspace}/data/train"
test_data_path: "{workspace}/data/test"
word_count_dict_path: "{workspace}/data/dict/word_count_dict.txt" word_count_dict_path: "{workspace}/data/dict/word_count_dict.txt"
word_id_dict_path: "{workspace}/data/dict/word_id_dict.txt"
model: model:
models: "{workspace}/model.py" models: "{workspace}/model.py"
hyper_parameters: hyper_parameters:
sparse_feature_number: 354051 sparse_feature_number: 85
sparse_feature_dim: 300 sparse_feature_dim: 300
with_shuffle_batch: False with_shuffle_batch: False
neg_num: 5 neg_num: 5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册