diff --git a/core/leras/nn.py b/core/leras/nn.py index 6504698..7d62393 100644 --- a/core/leras/nn.py +++ b/core/leras/nn.py @@ -70,19 +70,23 @@ class nn(): first_run = True 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_CPP_MIN_LOG_LEVEL'] = '2' # tf log errors only + os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # tf log errors only if first_run: io.log_info("Caching GPU kernels...") - import tensorflow as tf - nn.tf = tf + #import tensorflow as tf + import tensorflow.compat.v1 as tf import logging # 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 import core.leras.ops diff --git a/core/leras/ops/__init__.py b/core/leras/ops/__init__.py index ddf1c06..443549a 100644 --- a/core/leras/ops/__init__.py +++ b/core/leras/ops/__init__.py @@ -333,7 +333,17 @@ def depth_to_space(x, size): x = tf.reshape(x, (-1, oh, ow, oc, )) return x 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) + nn.depth_to_space = depth_to_space def rgb_to_lab(srgb): diff --git a/core/mplib/MPSharedList.py b/core/mplib/MPSharedList.py index 658f9fc..0b75b33 100644 --- a/core/mplib/MPSharedList.py +++ b/core/mplib/MPSharedList.py @@ -114,7 +114,7 @@ class ArrayFillerSubprocessor(Subprocessor): def __init__(self, sh_b, data_list ): self.sh_b = sh_b self.data_list = data_list - super().__init__('ArrayFillerSubprocessor', ArrayFillerSubprocessor.Cli, 60) + super().__init__('ArrayFillerSubprocessor', ArrayFillerSubprocessor.Cli, 60, io_loop_sleep_time=0.001) #override def process_info_generator(self): @@ -124,7 +124,7 @@ class ArrayFillerSubprocessor(Subprocessor): #override def get_data(self, host_dict): if len(self.data_list) > 0: - return self.data_list.pop(0) + return self.data_list.pop(-1) return None diff --git a/project.code-workspace b/project.code-workspace deleted file mode 100644 index 07fae2f..0000000 --- a/project.code-workspace +++ /dev/null @@ -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" - ] - } -} \ No newline at end of file diff --git a/requirements-colab.txt b/requirements-colab.txt index 128a518..5164319 100644 --- a/requirements-colab.txt +++ b/requirements-colab.txt @@ -6,4 +6,4 @@ ffmpeg-python==0.1.17 scikit-image==0.14.2 scipy==1.4.1 colorama -tensorflow-gpu==1.13.2 \ No newline at end of file +tensorflow-gpu==2.4.0rc1 \ No newline at end of file diff --git a/requirements-cuda.txt b/requirements-cuda.txt index 8df3478..f626a14 100644 --- a/requirements-cuda.txt +++ b/requirements-cuda.txt @@ -7,5 +7,5 @@ scikit-image==0.14.2 scipy==1.4.1 colorama labelme==4.2.9 -tensorflow-gpu==1.13.2 +tensorflow-gpu==2.4.0rc1 pyqt5 \ No newline at end of file