提交 43570546 编写于 作者: J JiabinYang

fix fix_train_without_third_party_vocab

上级 9a4f5786
......@@ -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:
......
......@@ -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(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册