提交 6bb1a961 编写于 作者: G gmcather

fix code style3

上级 99ad2383
......@@ -18,7 +18,7 @@ def infer(test_reader, use_cuda, model_path=None):
place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace()
exe = fluid.Executor(place)
inference_scope = fluid.core.Scope()
with fluid.scope_guard(inference_scope):
[inference_program, feed_target_names,
......@@ -46,4 +46,3 @@ if __name__ == "__main__":
for i in range(30):
epoch_path = model_path + "/" + "epoch" + str(i)
infer(test_reader, use_cuda=False, model_path=epoch_path)
......@@ -125,5 +125,6 @@ def train_net():
print("network name cannot be found!")
sys.exit(1)
if __name__ == "__main__":
train_net()
......@@ -78,7 +78,7 @@ def prepare_data(data_type="imdb",
paddle.reader.shuffle(
paddle.dataset.imdb.test(word_dict), buf_size=buf_size),
batch_size=batch_size)
elif data_type == "light_imdb":
train_reader = paddle.batch(
paddle.reader.shuffle(
......@@ -91,7 +91,7 @@ def prepare_data(data_type="imdb",
batch_size=batch_size)
elif data_type == "tiny_imdb":
train_reader=paddle.batch(
train_reader = paddle.batch(
paddle.reader.shuffle(
tiny_imdb.train(word_dict), buf_size=buf_size),
batch_size=batch_size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册