Skip to content

Commit 443e7cc

Browse files
committed
FIX: TF1.9 no longer has _StreamingModelPortProcessor.
- as walkerensembleoptimizer modifies parts of the non-public Optimizer interface, we need to adapt whenever they change it. - since TF 1.9 Intel's MKL is sort-of standard, e.g., anaconda uses it out of the box. This causes the test Optimizer two spirals to fail because suddenly 4 threads instead of 1 is used. I am trying to find out how to prevent MKL threads ... at least for the purpose of the test.
1 parent b86503e commit 443e7cc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/TATi/samplers/walkerensembleoptimizer.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from tensorflow.python.framework import ops
66
from tensorflow.python.ops import variables
77
from tensorflow.python.training.optimizer import Optimizer, _DenseResourceVariableProcessor, \
8-
_OptimizableVariable, _StreamingModelPortProcessor
8+
_OptimizableVariable
99
import tensorflow as tf
1010

1111
from distutils.version import LooseVersion
@@ -16,6 +16,9 @@
1616
if LooseVersion(tf.__version__) < LooseVersion("1.8.0"):
1717
from tensorflow.python.training.optimizer import _get_variable_for
1818

19+
if LooseVersion(tf.__version__) < LooseVersion("1.9.0"):
20+
from tensorflow.python.training.optimizer import _StreamingModelPortProcessor
21+
1922
import collections
2023

2124
from TATi.models.basetype import dds_basetype
@@ -69,8 +72,9 @@ def _get_processor(v):
6972
return _DenseResourceVariableProcessor(v)
7073
if isinstance(v, variables.Variable):
7174
return RefVariableWalkerEnsembleProcessor(v)
72-
if v.op.type == "SubmodelPort":
73-
return _StreamingModelPortProcessor(v)
75+
if LooseVersion(tf.__version__) < LooseVersion("1.9.0"):
76+
if v.op.type == "SubmodelPort":
77+
return _StreamingModelPortProcessor(v)
7478
if LooseVersion(tf.__version__) >= LooseVersion("1.7.0"):
7579
if isinstance(v, ops.Tensor):
7680
return _TensorProcessor(v)

0 commit comments

Comments
 (0)