Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for TF 2.3.0 #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions model_training_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def train_steps(iterator, steps):
'retracing.')

for _ in tf.range(steps):
strategy.experimental_run_v2(_replicated_step, args=(next(iterator),))
strategy.run(_replicated_step, args=(next(iterator),))

def train_single_step(iterator):
"""Performs a distributed training step.
Expand All @@ -247,7 +247,7 @@ def train_single_step(iterator):
Raises:
ValueError: Any of the arguments or tensor shapes are invalid.
"""
strategy.experimental_run_v2(_replicated_step, args=(next(iterator),))
strategy.run(_replicated_step, args=(next(iterator),))

def test_step(iterator):
"""Calculates evaluation metrics on distributed devices."""
Expand All @@ -260,7 +260,7 @@ def _test_step_fn(inputs):
for metric in eval_metrics:
metric.update_state(labels, model_outputs)

strategy.experimental_run_v2(_test_step_fn, args=(next(iterator),))
strategy.run(_replicated_step, args=(next(iterator),))

if not run_eagerly:
train_single_step = tf.function(train_single_step)
Expand Down