mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-07 13:32:09 -07:00
SampleGeneratorFace optimizations
This commit is contained in:
parent
9535a657d2
commit
c0a63addd4
2 changed files with 33 additions and 55 deletions
|
@ -31,8 +31,8 @@ class SubprocessGenerator(object):
|
|||
self.cs_queue = multiprocessing.Queue()
|
||||
self.p = None
|
||||
|
||||
def process_func(self):
|
||||
self.generator_func = self.generator_func(self.user_param)
|
||||
def process_func(self, user_param):
|
||||
self.generator_func = self.generator_func(user_param)
|
||||
while True:
|
||||
while self.prefetch > -1:
|
||||
try:
|
||||
|
@ -50,7 +50,9 @@ class SubprocessGenerator(object):
|
|||
|
||||
def __next__(self):
|
||||
if self.p == None:
|
||||
self.p = multiprocessing.Process(target=self.process_func, args=())
|
||||
user_param = self.user_param
|
||||
self.user_param = None
|
||||
self.p = multiprocessing.Process(target=self.process_func, args=(user_param,) )
|
||||
self.p.daemon = True
|
||||
self.p.start()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue