Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49d7c0e

Browse files
author
Taylor Robie
committed
modify resent to run many loops quickly
1 parent 1f48409 commit 49d7c0e

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

official/resnet/resnet_run_loop.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import math
2727
import os
28+
import sys
2829

2930
# pylint: disable=g-bad-import-order
3031
from absl import flags
@@ -389,6 +390,12 @@ def resnet_main(
389390
This is only used if flags_obj.export_dir is passed.
390391
"""
391392

393+
print("\n" * 3)
394+
tf.logging.info("TF version: {}".format(tf.VERSION))
395+
tf.logging.info("TF git version: {}".format(tf.GIT_VERSION))
396+
print("\n" * 3)
397+
sys.stdout.flush()
398+
392399
model_helpers.apply_clean(flags.FLAGS)
393400

394401
# Using the Winograd non-fused algorithms provides a small performance boost.
@@ -487,7 +494,9 @@ def input_fn_eval():
487494

488495
if num_train_epochs:
489496
classifier.train(input_fn=lambda: input_fn_train(num_train_epochs),
490-
hooks=train_hooks, max_steps=flags_obj.max_train_steps)
497+
hooks=train_hooks, steps=5)
498+
499+
continue # We don't need eval for this repro.
491500

492501
tf.logging.info('Starting to evaluate.')
493502

official/resnet/run_repro.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
pushd ../..
5+
export PYTHONPATH=$(pwd)
6+
popd
7+
8+
TIME=$(date +%s)
9+
10+
python3 imagenet_main.py --clean --data_dir /imn/imagenet/combined/ \
11+
--model_dir /tmp/garden_imagenet --train_epochs 30 --batch_size 2048 --resnet_version 1 \
12+
--resnet_size 50 --dtype fp16 --num_gpus 8 |& tee imagenet_garden_${TIME}.log

0 commit comments

Comments
 (0)