From afcd4ee315ae71ef6d79ddab32934ad609670338 Mon Sep 17 00:00:00 2001 From: Ughur Mammadzada Date: Thu, 22 May 2025 16:06:47 +0200 Subject: [PATCH] fix: release memory after predict / (restored from v2.7 commit 15963b0d242867a4cc4d76445626dc8965509b2f --- tools/infer/predict_rec.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index 06b318eb35e..79abf719e5e 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -679,6 +679,7 @@ def __call__(self, img_list): for output_tensor in self.output_tensors: output = output_tensor.copy_to_cpu() outputs.append(output) + self.predictor.try_shrink_memory() if self.benchmark: self.autolog.times.stamp() if len(outputs) != 1: