diff --git a/fluid/PaddleRec/word2vec/reader.py b/fluid/PaddleRec/word2vec/reader.py index 3eae59cf510790ebc64f88d838863a3353a98ae4..df479a4b71bbb4c2b2297c4d04afe275ba1c9a81 100644 --- a/fluid/PaddleRec/word2vec/reader.py +++ b/fluid/PaddleRec/word2vec/reader.py @@ -70,8 +70,8 @@ class Word2VecReader(object): self.word_frequencys = [ float(count) / word_all_count for count in word_counts ] - print("dict_size = " + str( - self.dict_size)) + " word_all_count = " + str(word_all_count) + print("dict_size = " + str(self.dict_size) + " word_all_count = " + str( + word_all_count)) with io.open(dict_path + "_ptable", 'r', encoding='utf-8') as f2: for line in f2: diff --git a/fluid/PaddleRec/word2vec/train.py b/fluid/PaddleRec/word2vec/train.py index 97e6fa67a4f402d8543711c0186194e8c642a956..2c8512e4954c60a9f0f0c45533c08170d4e6e09b 100644 --- a/fluid/PaddleRec/word2vec/train.py +++ b/fluid/PaddleRec/word2vec/train.py @@ -203,7 +203,7 @@ def train_loop(args, train_program, reader, py_reader, loss, trainer_id): time.sleep(10) epoch_start = time.time() batch_id = 0 - start = time.clock() + start = time.time() try: while True: @@ -218,8 +218,8 @@ def train_loop(args, train_program, reader, py_reader, loss, trainer_id): loss_val.mean(), py_reader.queue.size())) if args.with_speed: if batch_id % 1000 == 0 and batch_id != 0: - elapsed = (time.clock() - start) - start = time.clock() + elapsed = (time.time() - start) + start = time.time() samples = 1001 * args.batch_size * int( os.getenv("CPU_NUM")) logger.info("Time used: {}, Samples/Sec: {}".format(