mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
optimize memory usage
This commit is contained in:
parent
f95682f616
commit
2429d28737
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
import gc
|
||||
import multiprocessing
|
||||
import operator
|
||||
import pickle
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -58,6 +60,11 @@ class SampleHost:
|
|||
if result is None:
|
||||
result = SampleHost.load_face_samples( Path_utils.get_image_paths(samples_path) )
|
||||
|
||||
result_dmp = pickle.dumps(result)
|
||||
del result
|
||||
gc.collect()
|
||||
result = pickle.loads(result_dmp)
|
||||
|
||||
samples[sample_type] = result
|
||||
|
||||
elif sample_type == SampleType.FACE_TEMPORAL_SORTED:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue