Unverified Commit 668a47d2 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #1515 from peastman/tf112

Upgrade to TensorFlow 1.12
parents 3574d1c3 5f07396e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -439,7 +439,7 @@ class SharedVariableScope(Layer):

  def _get_scope_name(self):
    if tfe.in_eager_mode():
      return None
      return self.name
    if self._shared_with is None:
      return self.name
    else:
+17 −1
Original line number Diff line number Diff line
@@ -1030,6 +1030,9 @@ class TensorGraph(Model):
    if obj in self.tensor_objects and self.tensor_objects[obj] is not None:
      return self.tensor_objects[obj]
    if obj == "Graph":
      if tfe.in_eager_mode():
        self.tensor_objects['Graph'] = _DummyGraph()
      else:
        self.tensor_objects['Graph'] = tf.Graph()
    elif obj == "FileWriter":
      self.tensor_objects['FileWriter'] = tf.summary.FileWriter(self.model_dir)
@@ -1412,6 +1415,19 @@ class TFWrapper(object):
    return self.tf_class(**self.kwargs)


class _DummyGraph(object):
  """This is used in eager mode as the "graph" object for the model.  It does nothing."""

  def as_default(self):
    return self

  def __enter__(self):
    pass

  def __exit__(self, type, value, traceback):
    pass


class Submodel(object):
  """An alternate objective for training one piece of a TensorGraph."""

+608 −673

File changed.

Preview size limit exceeded, changes collapsed.

+25 −37
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_single_task_classifier_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_single_task_classifier()

  @flaky
@@ -96,7 +95,6 @@ class TestTensorGraph(unittest.TestCase):
  @flaky
  def test_multi_task_classifier_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_multi_task_classifier()

  def test_single_task_regressor(self):
@@ -118,7 +116,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_single_task_regressor_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_single_task_regressor()

  def test_multi_task_regressor(self):
@@ -165,7 +162,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_multi_task_regressor_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_multi_task_regressor()

  @flaky
@@ -219,7 +215,6 @@ class TestTensorGraph(unittest.TestCase):
  @flaky
  def test_set_optimizer_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_set_optimizer()

  def test_tensorboard(self):
@@ -252,7 +247,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_tensorboard_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_tensorboard()

  def test_save_load(self):
@@ -288,7 +282,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_save_load_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_save_load()

  def test_shared_layer(self):
@@ -370,7 +363,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_operators_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_operators()

  def test_initialize_variable(self):
@@ -396,7 +388,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_initialize_variable_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_initialize_variable()

  def test_copy_layers(self):
@@ -427,7 +418,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_copy_layers_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_copy_layers()

  def test_copy_layers_shared(self):
@@ -498,7 +488,6 @@ class TestTensorGraph(unittest.TestCase):

  def test_submodels_eager(self):
    with context.eager_mode():
      with tfe.IsolateTest():
      self.test_submodels()

  def test_recurrent_layer(self):
@@ -533,7 +522,6 @@ class TestTensorGraph(unittest.TestCase):
  def test_invoke_model_eager(self):
    """Test invoking the model with __call__() in eager mode."""
    with context.eager_mode():
      with tfe.IsolateTest():
      batch_size = 5
      tg = dc.models.TensorGraph(batch_size=batch_size)
      features = Feature(shape=(None, 10))
+1 −1
Original line number Diff line number Diff line
@@ -62,4 +62,4 @@ conda install -y -q -c conda-forge joblib=0.11 \
    setuptools=39.0.1 \
    biopython=1.71 \
    numpy=1.14
yes | pip install $tensorflow==1.6.0
yes | pip install $tensorflow==1.12.0