mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
upgrade to tf 2.4.0rc1
This commit is contained in:
parent
8b9b907682
commit
0eb7e06ac1
6 changed files with 23 additions and 59 deletions
|
@ -70,19 +70,23 @@ class nn():
|
||||||
first_run = True
|
first_run = True
|
||||||
os.environ['CUDA_CACHE_PATH'] = str(compute_cache_path)
|
os.environ['CUDA_CACHE_PATH'] = str(compute_cache_path)
|
||||||
|
|
||||||
os.environ['CUDA_CACHE_MAXSIZE'] = '536870912' #512Mb (32mb default)
|
#nvcuda.dll ignores this param : os.environ['CUDA_CACHE_MAXSIZE'] = '536870912' #512Mb (32mb default)
|
||||||
os.environ['TF_MIN_GPU_MULTIPROCESSOR_COUNT'] = '2'
|
os.environ['TF_MIN_GPU_MULTIPROCESSOR_COUNT'] = '2'
|
||||||
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # tf log errors only
|
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # tf log errors only
|
||||||
|
|
||||||
if first_run:
|
if first_run:
|
||||||
io.log_info("Caching GPU kernels...")
|
io.log_info("Caching GPU kernels...")
|
||||||
|
|
||||||
import tensorflow as tf
|
#import tensorflow as tf
|
||||||
nn.tf = tf
|
import tensorflow.compat.v1 as tf
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
# Disable tensorflow warnings
|
# Disable tensorflow warnings
|
||||||
logging.getLogger('tensorflow').setLevel(logging.ERROR)
|
tf_logger = logging.getLogger('tensorflow')
|
||||||
|
tf_logger.setLevel(logging.ERROR)
|
||||||
|
|
||||||
|
tf.disable_v2_behavior()
|
||||||
|
nn.tf = tf
|
||||||
|
|
||||||
# Initialize framework
|
# Initialize framework
|
||||||
import core.leras.ops
|
import core.leras.ops
|
||||||
|
|
|
@ -333,7 +333,17 @@ def depth_to_space(x, size):
|
||||||
x = tf.reshape(x, (-1, oh, ow, oc, ))
|
x = tf.reshape(x, (-1, oh, ow, oc, ))
|
||||||
return x
|
return x
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
b,c,h,w = x.shape.as_list()
|
||||||
|
oh, ow = h * size, w * size
|
||||||
|
oc = c // (size * size)
|
||||||
|
|
||||||
|
x = tf.reshape(x, (-1, size, size, oc, h, w, ) )
|
||||||
|
x = tf.transpose(x, (0, 3, 4, 1, 5, 2))
|
||||||
|
x = tf.reshape(x, (-1, oc, oh, ow))
|
||||||
|
return x
|
||||||
return tf.depth_to_space(x, size, data_format=nn.data_format)
|
return tf.depth_to_space(x, size, data_format=nn.data_format)
|
||||||
|
|
||||||
nn.depth_to_space = depth_to_space
|
nn.depth_to_space = depth_to_space
|
||||||
|
|
||||||
def rgb_to_lab(srgb):
|
def rgb_to_lab(srgb):
|
||||||
|
|
|
@ -114,7 +114,7 @@ class ArrayFillerSubprocessor(Subprocessor):
|
||||||
def __init__(self, sh_b, data_list ):
|
def __init__(self, sh_b, data_list ):
|
||||||
self.sh_b = sh_b
|
self.sh_b = sh_b
|
||||||
self.data_list = data_list
|
self.data_list = data_list
|
||||||
super().__init__('ArrayFillerSubprocessor', ArrayFillerSubprocessor.Cli, 60)
|
super().__init__('ArrayFillerSubprocessor', ArrayFillerSubprocessor.Cli, 60, io_loop_sleep_time=0.001)
|
||||||
|
|
||||||
#override
|
#override
|
||||||
def process_info_generator(self):
|
def process_info_generator(self):
|
||||||
|
@ -124,7 +124,7 @@ class ArrayFillerSubprocessor(Subprocessor):
|
||||||
#override
|
#override
|
||||||
def get_data(self, host_dict):
|
def get_data(self, host_dict):
|
||||||
if len(self.data_list) > 0:
|
if len(self.data_list) > 0:
|
||||||
return self.data_list.pop(0)
|
return self.data_list.pop(-1)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
{
|
|
||||||
"folders": [
|
|
||||||
{
|
|
||||||
"path": "."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"settings": {
|
|
||||||
"workbench.colorTheme": "Visual Studio Light",
|
|
||||||
"diffEditor.ignoreTrimWhitespace": true,
|
|
||||||
"workbench.sideBar.location": "right",
|
|
||||||
"breadcrumbs.enabled": false,
|
|
||||||
"editor.renderWhitespace": "none",
|
|
||||||
"editor.minimap.enabled": false,
|
|
||||||
"workbench.activityBar.visible": true,
|
|
||||||
"window.menuBarVisibility": "default",
|
|
||||||
"editor.fastScrollSensitivity": 10,
|
|
||||||
"editor.mouseWheelScrollSensitivity": 2,
|
|
||||||
"window.zoomLevel": 0,
|
|
||||||
"extensions.ignoreRecommendations": true,
|
|
||||||
|
|
||||||
"python.linting.pylintEnabled": false,
|
|
||||||
"python.linting.enabled": false,
|
|
||||||
"python.linting.pylamaEnabled": false,
|
|
||||||
"python.linting.pydocstyleEnabled": false,
|
|
||||||
"python.pythonPath": "${env:PYTHON_EXECUTABLE}",
|
|
||||||
"workbench.editor.tabCloseButton": "off",
|
|
||||||
"workbench.editor.tabSizing": "shrink",
|
|
||||||
"workbench.editor.highlightModifiedTabs": true,
|
|
||||||
"editor.mouseWheelScrollSensitivity": 3,
|
|
||||||
"editor.folding": false,
|
|
||||||
"editor.glyphMargin": false,
|
|
||||||
"files.exclude": {
|
|
||||||
"**/__pycache__": true,
|
|
||||||
"**/.github": true,
|
|
||||||
"**/.vscode": true,
|
|
||||||
"**/*.dat": true,
|
|
||||||
"**/*.h5": true,
|
|
||||||
"**/*.npy": true
|
|
||||||
},
|
|
||||||
"editor.quickSuggestions": {
|
|
||||||
"other": false,
|
|
||||||
"comments": false,
|
|
||||||
"strings": false
|
|
||||||
},
|
|
||||||
"editor.trimAutoWhitespace": false,
|
|
||||||
"python.linting.pylintArgs": [
|
|
||||||
"--disable=import-error"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,4 +6,4 @@ ffmpeg-python==0.1.17
|
||||||
scikit-image==0.14.2
|
scikit-image==0.14.2
|
||||||
scipy==1.4.1
|
scipy==1.4.1
|
||||||
colorama
|
colorama
|
||||||
tensorflow-gpu==1.13.2
|
tensorflow-gpu==2.4.0rc1
|
|
@ -7,5 +7,5 @@ scikit-image==0.14.2
|
||||||
scipy==1.4.1
|
scipy==1.4.1
|
||||||
colorama
|
colorama
|
||||||
labelme==4.2.9
|
labelme==4.2.9
|
||||||
tensorflow-gpu==1.13.2
|
tensorflow-gpu==2.4.0rc1
|
||||||
pyqt5
|
pyqt5
|
Loading…
Add table
Add a link
Reference in a new issue