From cb84cbab9dcc6acca30d65de569bc98770edef41 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 24 Apr 2017 16:42:58 +0800 Subject: [PATCH] add .tar.gz suffix to parameter save filename --- demo/word2vec/api_train_v2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/word2vec/api_train_v2.py b/demo/word2vec/api_train_v2.py index a224951f4d4..c0940f0e56e 100644 --- a/demo/word2vec/api_train_v2.py +++ b/demo/word2vec/api_train_v2.py @@ -70,7 +70,8 @@ def main(): def event_handler(event): if isinstance(event, paddle.event.EndIteration): if event.batch_id % 100 == 0: - with gzip.open("batch-" + str(event.batch_id), 'w') as f: + with gzip.open("batch-" + str(event.batch_id) + ".tar.gz", + 'w') as f: trainer.save_parameter_to_tar(f) result = trainer.test( paddle.batch( -- GitLab