From 8dc2d4b8255c96f6d35b7b54398f8c0d31c707b6 Mon Sep 17 00:00:00 2001 From: tianxin Date: Thu, 18 Jul 2019 11:46:46 +0800 Subject: [PATCH] enable gc for predict_classify --- ERNIE/predict_classifier.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ERNIE/predict_classifier.py b/ERNIE/predict_classifier.py index ecda8a3..e6115da 100644 --- a/ERNIE/predict_classifier.py +++ b/ERNIE/predict_classifier.py @@ -22,6 +22,12 @@ import time import argparse import numpy as np import multiprocessing + +# NOTE(paddle-dev): All of these flags should be +# set before `import paddle`. Otherwise, it would +# not take any effect. +os.environ['FLAGS_eager_delete_tensor_gb'] = '0' # enable gc + import paddle.fluid as fluid from reader.task_reader import ClassifyReader -- GitLab