提交 c443f9b8 编写于 作者: Y Yibing Liu

Merge branch 'develop' of upstream into sequence_tagging_for_ner_ce

......@@ -145,7 +145,7 @@ def train(train_reader,
if pass_idx == pass_num - 1 and args.enable_ce:
#Note: The following logs are special for CE monitoring.
#Other situations do not need to care about these logs.
gpu_num = get_cards()
gpu_num = get_cards(args.enable_ce)
if gpu_num == 1:
print("kpis imikolov_20_pass_duration %s" %
(total_time / epoch_idx))
......
......@@ -4,8 +4,8 @@ import unittest
import contextlib
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.v2 as paddle
import utils
......
......@@ -4,8 +4,8 @@ import time
import unittest
import contextlib
import paddle
import paddle.fluid as fluid
import paddle.v2 as paddle
import utils
from nets import bow_net
......@@ -55,7 +55,7 @@ def train(train_reader,
feeder = fluid.DataFeeder(feed_list=[data, label], place=place)
# For internal continuous evaluation
if 'CE_MODE_X' in os.environ:
if "CE_MODE_X" in os.environ:
fluid.default_startup_program().random_seed = 110
exe.run(fluid.default_startup_program())
for pass_id in xrange(pass_num):
......@@ -80,7 +80,7 @@ def train(train_reader,
pass_end = time.time()
# For internal continuous evaluation
if 'CE_MODE_X' in os.environ:
if "CE_MODE_X" in os.environ:
print("kpis train_acc %f" % avg_acc)
print("kpis train_cost %f" % avg_cost)
print("kpis train_duration %f" % (pass_end - pass_start))
......
......@@ -65,7 +65,7 @@ def prepare_data(data_type="imdb",
raise RuntimeError("No such dataset")
if data_type == "imdb":
if 'CE_MODE_X' in os.environ:
if "CE_MODE_X" in os.environ:
train_reader = paddle.batch(
paddle.dataset.imdb.train(word_dict), batch_size=batch_size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册