From fa67e6e83e34fe0872893412147d77cd2f0c28b8 Mon Sep 17 00:00:00 2001 From: whs Date: Fri, 25 Oct 2019 12:55:15 +0800 Subject: [PATCH] Fix unitest of pruning in python3 env. (#20825) test=develop --- python/paddle/fluid/contrib/slim/core/compressor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/contrib/slim/core/compressor.py b/python/paddle/fluid/contrib/slim/core/compressor.py index 21737c76251..41f282bf997 100644 --- a/python/paddle/fluid/contrib/slim/core/compressor.py +++ b/python/paddle/fluid/contrib/slim/core/compressor.py @@ -55,7 +55,9 @@ def cached_reader(reader, sampled_rate, cache_path, cached_id): def s_reader(): if os.path.isdir(cache_path): for file_name in open(os.path.join(cache_path, "list")): - yield np.load(os.path.join(cache_path, file_name.strip())) + yield np.load( + os.path.join(cache_path, file_name.strip()), + allow_pickle=True) else: os.makedirs(cache_path) list_file = open(os.path.join(cache_path, "list"), 'w') -- GitLab