diff --git a/demo/word2vec/api_train_v2.py b/demo/word2vec/api_train_v2.py index a224951f4d4c86807294fa2fbcca2cfc38af915f..c0940f0e56eafa22f8aeb7052c0ddc79d8862917 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(