"vscode:/vscode.git/clone" did not exist on "4c19e2cb3ef78ab3f6ae4052182c3aeed4817d08"
Unverified Commit 391938b0 authored by Asim Shankar's avatar Asim Shankar Committed by GitHub
Browse files

Merge pull request #3190 from asimshankar/mnist-file

[mnist]: TPU tweaks
parents 9325ea8f 2cfba666
...@@ -59,11 +59,11 @@ def check_labels_file_header(filename): ...@@ -59,11 +59,11 @@ def check_labels_file_header(filename):
def download(directory, filename): def download(directory, filename):
"""Download (and unzip) a file from the MNIST dataset, if it doesn't already exist.""" """Download (and unzip) a file from the MNIST dataset, if it doesn't already exist."""
if not tf.gfile.Exists(directory):
tf.gfile.MakeDirs(directory)
filepath = os.path.join(directory, filename) filepath = os.path.join(directory, filename)
if tf.gfile.Exists(filepath): if tf.gfile.Exists(filepath):
return filepath return filepath
if not tf.gfile.Exists(directory):
tf.gfile.MakeDirs(directory)
# CVDF mirror of http://yann.lecun.com/exdb/mnist/ # CVDF mirror of http://yann.lecun.com/exdb/mnist/
url = 'https://storage.googleapis.com/cvdf-datasets/mnist/' + filename + '.gz' url = 'https://storage.googleapis.com/cvdf-datasets/mnist/' + filename + '.gz'
zipped_filepath = filepath + '.gz' zipped_filepath = filepath + '.gz'
......
...@@ -133,7 +133,8 @@ def main(argv): ...@@ -133,7 +133,8 @@ def main(argv):
# Note that the number of examples used during evaluation is # Note that the number of examples used during evaluation is
# --eval_steps * --batch_size. # --eval_steps * --batch_size.
# So if you change --batch_size then change --eval_steps too. # So if you change --batch_size then change --eval_steps too.
estimator.evaluate(input_fn=eval_input_fn, steps=FLAGS.eval_steps) if FLAGS.eval_steps:
estimator.evaluate(input_fn=eval_input_fn, steps=FLAGS.eval_steps)
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment