Skip to content

Commit 5ef68f5

Browse files
author
Taylor Robie
authored
Set correct number of train_epochs for resnet on imagenet, and fix help interception caused by moving arg parsing into main functions for resnet. (#3653)
1 parent 7cfb6bb commit 5ef68f5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

official/resnet/cifar10_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,4 @@ def main(argv):
233233

234234
if __name__ == '__main__':
235235
tf.logging.set_verbosity(tf.logging.INFO)
236-
tf.app.run(argv=sys.argv)
236+
main(argv=sys.argv)

official/resnet/imagenet_main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ def imagenet_model_fn(features, labels, mode, params):
297297
def main(argv):
298298
parser = resnet_run_loop.ResnetArgParser(
299299
resnet_size_choices=[18, 34, 50, 101, 152, 200])
300+
301+
parser.set_defaults(
302+
train_epochs=100
303+
)
304+
300305
flags = parser.parse_args(args=argv[1:])
301306

302307
input_function = flags.use_synthetic_data and get_synth_input_fn() or input_fn
@@ -305,4 +310,4 @@ def main(argv):
305310

306311
if __name__ == '__main__':
307312
tf.logging.set_verbosity(tf.logging.INFO)
308-
tf.app.run(argv=sys.argv)
313+
main(argv=sys.argv)

0 commit comments

Comments
 (0)