diff --git a/tools/infer/utility.py b/tools/infer/utility.py index ba5a3f386e0fa967b23a65fe5c397b76cf04397c..b3d15f01213d417181b93b66f030d18e1ac86df5 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -88,6 +88,7 @@ def create_predictor(args, mode): if args.use_gpu: config.enable_use_gpu(args.gpu_mem, 0) + config.enable_memory_optim() else: config.disable_gpu() @@ -310,4 +311,4 @@ if __name__ == '__main__': new_img = draw_ocr(image, boxes, txts, scores, draw_txt=True) - cv2.imwrite(img_name, new_img) \ No newline at end of file + cv2.imwrite(img_name, new_img)