Skip to content

Commit

Permalink
Fix usage of logging API.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 463123944
  • Loading branch information
michaelreneer authored and tensorflower-gardener committed Jul 25, 2022
1 parent 4cb0a11 commit d16f020
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def load_cifar10():


def main(unused_argv):
logger = tf.get_logger()
logger.set_level(logging.ERROR)
logging.set_verbosity(logging.ERROR)

# Load training and test data.
x_train, y_train, x_test, y_test = load_cifar10()
Expand Down
3 changes: 1 addition & 2 deletions tutorials/lm_dpsgd_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def compute_epsilon(steps):


def main(unused_argv):
logger = tf.get_logger()
logger.set_level(logging.INFO)
logging.set_verbosity(logging.INFO)

if FLAGS.batch_size % FLAGS.microbatches != 0:
raise ValueError('Number of microbatches should divide evenly batch_size')
Expand Down
3 changes: 1 addition & 2 deletions tutorials/mnist_dpsgd_tutorial_vectorized.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def load_mnist():


def main(unused_argv):
logger = tf.get_logger()
logger.set_level(logging.INFO)
logging.set_verbosity(logging.INFO)

if FLAGS.dpsgd and FLAGS.batch_size % FLAGS.microbatches != 0:
raise ValueError('Number of microbatches should divide evenly batch_size')
Expand Down
3 changes: 1 addition & 2 deletions tutorials/mnist_lr_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ def print_privacy_guarantees(epochs, batch_size, samples, noise_multiplier):


def main(unused_argv):
logger = tf.get_logger()
logger.set_level(logging.INFO)
logging.set_verbosity(logging.INFO)

if FLAGS.data_l2_norm <= 0:
raise ValueError('data_l2_norm must be positive.')
Expand Down
3 changes: 1 addition & 2 deletions tutorials/walkthrough/mnist_scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def load_mnist():


def main(unused_argv):
logger = tf.get_logger()
logger.set_level(logging.INFO)
logging.set_verbosity(logging.INFO)

# Load training and test data.
train_data, train_labels, test_data, test_labels = load_mnist()
Expand Down

0 comments on commit d16f020

Please sign in to comment.