mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 13:02:15 -07:00
_
This commit is contained in:
parent
c900c65c31
commit
27e24d5d28
4 changed files with 9 additions and 25 deletions
|
@ -357,8 +357,6 @@ class InteractBase(object):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def input_process(self, stdin_fd, sq, str):
|
def input_process(self, stdin_fd, sq, str):
|
||||||
from core import osex
|
|
||||||
osex.linux_ignore_UserWarning()
|
|
||||||
sys.stdin = os.fdopen(stdin_fd)
|
sys.stdin = os.fdopen(stdin_fd)
|
||||||
try:
|
try:
|
||||||
inp = input (str)
|
inp = input (str)
|
||||||
|
@ -387,9 +385,6 @@ class InteractBase(object):
|
||||||
return inp
|
return inp
|
||||||
|
|
||||||
def input_process_skip_pending(self, stdin_fd):
|
def input_process_skip_pending(self, stdin_fd):
|
||||||
from core import osex
|
|
||||||
osex.linux_ignore_UserWarning()
|
|
||||||
|
|
||||||
sys.stdin = os.fdopen(stdin_fd)
|
sys.stdin = os.fdopen(stdin_fd)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -54,10 +54,7 @@ class Subprocessor(object):
|
||||||
def log_err(self, msg): self.c2s.put ( {'op': 'log_err' , 'msg':msg } )
|
def log_err(self, msg): self.c2s.put ( {'op': 'log_err' , 'msg':msg } )
|
||||||
def progress_bar_inc(self, c): self.c2s.put ( {'op': 'progress_bar_inc' , 'c':c } )
|
def progress_bar_inc(self, c): self.c2s.put ( {'op': 'progress_bar_inc' , 'c':c } )
|
||||||
|
|
||||||
def _subprocess_run(self, client_dict, s2c, c2s):
|
def _subprocess_run(self, client_dict, s2c, c2s):
|
||||||
from core import osex
|
|
||||||
osex.linux_ignore_UserWarning()
|
|
||||||
|
|
||||||
self.c2s = c2s
|
self.c2s = c2s
|
||||||
data = None
|
data = None
|
||||||
is_error = False
|
is_error = False
|
||||||
|
@ -80,7 +77,7 @@ class Subprocessor(object):
|
||||||
time.sleep(0.001)
|
time.sleep(0.001)
|
||||||
|
|
||||||
self.on_finalize()
|
self.on_finalize()
|
||||||
c2s.put ( {'op': 'finalized'} )
|
c2s.put ( {'op': 'finalized'} )
|
||||||
except Subprocessor.SilenceException as e:
|
except Subprocessor.SilenceException as e:
|
||||||
c2s.put ( {'op': 'error', 'data' : data} )
|
c2s.put ( {'op': 'error', 'data' : data} )
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -89,7 +86,7 @@ class Subprocessor(object):
|
||||||
print ('Exception while process data [%s]: %s' % (self.get_data_name(data), traceback.format_exc()) )
|
print ('Exception while process data [%s]: %s' % (self.get_data_name(data), traceback.format_exc()) )
|
||||||
else:
|
else:
|
||||||
print ('Exception: %s' % (traceback.format_exc()) )
|
print ('Exception: %s' % (traceback.format_exc()) )
|
||||||
|
|
||||||
c2s.close()
|
c2s.close()
|
||||||
s2c.close()
|
s2c.close()
|
||||||
self.c2s = None
|
self.c2s = None
|
||||||
|
|
10
core/osex.py
10
core/osex.py
|
@ -33,12 +33,4 @@ def get_screen_size():
|
||||||
elif 'linux' in sys.platform:
|
elif 'linux' in sys.platform:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return (1366, 768)
|
return (1366, 768)
|
||||||
|
|
||||||
def linux_ignore_UserWarning():
|
|
||||||
if sys.platform[0:3] != 'win':
|
|
||||||
# fix for Linux , Ignoring :
|
|
||||||
# /usr/lib/python3.6/multiprocessing/semaphore_tracker.py:143:
|
|
||||||
# UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
|
|
||||||
import warnings
|
|
||||||
warnings.filterwarnings(action='ignore', message='semaphore_tracker')
|
|
10
main.py
10
main.py
|
@ -3,9 +3,6 @@ if __name__ == "__main__":
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
multiprocessing.set_start_method("spawn")
|
multiprocessing.set_start_method("spawn")
|
||||||
|
|
||||||
from core import osex
|
|
||||||
osex.linux_ignore_UserWarning()
|
|
||||||
|
|
||||||
from core.leras import nn
|
from core.leras import nn
|
||||||
nn.initialize_main_env()
|
nn.initialize_main_env()
|
||||||
|
|
||||||
|
@ -14,7 +11,8 @@ if __name__ == "__main__":
|
||||||
import time
|
import time
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from core import pathex
|
from core import pathex
|
||||||
|
from core import osex
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from core.interact import interact as io
|
from core.interact import interact as io
|
||||||
|
|
||||||
|
@ -352,7 +350,9 @@ if __name__ == "__main__":
|
||||||
arguments.func(arguments)
|
arguments.func(arguments)
|
||||||
|
|
||||||
print ("Done.")
|
print ("Done.")
|
||||||
|
else:
|
||||||
|
import warnings
|
||||||
|
warnings.filterwarnings(action='ignore', message='semaphore_tracker')
|
||||||
'''
|
'''
|
||||||
import code
|
import code
|
||||||
code.interact(local=dict(globals(), **locals()))
|
code.interact(local=dict(globals(), **locals()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue