Преглед на файлове

Manually delete the predictor to trigger its destructor, ensuring that the shape_range_info file would be saved

gaotingquan преди 8 месеца
родител
ревизия
0742a15ef8
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      paddlex/inference/models/common/static_infer.py

+ 3 - 0
paddlex/inference/models/common/static_infer.py

@@ -122,6 +122,9 @@ def _collect_trt_shape_range_info(
     # a garbage collector. Is there a more explicit and deterministic way to
     # handle this?
 
+    # HACK: Manually delete the predictor to trigger its destructor, ensuring that the shape_range_info file would be saved.
+    del predictor
+
 
 # pir trt
 def _convert_trt(