-
Notifications
You must be signed in to change notification settings - Fork 45.5k
ResNet argparse fixes. #3653
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
ResNet argparse fixes. #3653
Conversation
(1) The default should be set for Cifar too. |
@karmel The more I look at it I'm inclined to just drop tf.app.run() altogether in favor of just:
It appears to be primarily for arg parsing, so we basically have 2 arg parsers stepping on each other's toes. From what I've read it's not a necessity. |
6d68468
to
14a9d2c
Compare
Removing tf.app.run significantly simplified the amount of "counter magic" needed. |
official/resnet/imagenet_main.py
Outdated
|
||
def main(argv): | ||
def main(argv=None): | ||
argv = sys.argv if argv is None else argv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this at all if we're calling main directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The end to end test passes its own args instead of using sys.argv. I suppose we could also just make argv a required arg. Typically this argv=None pattern is what I've seen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more conventional then to have the if name ==
section pass in sys.argv, rather than having this extra line here.
The argv call is now in the ==main section. |
…lp interception caused by moving arg parsing into main functions for resnet. remove tf.app.run from resnet make argv explicit for main functions
c29d807
to
94c0177
Compare
As noted, imagenet can no longer just use the default number of train_epochs. This PR explicitly sets it back to 100, and also fixes a bug related to "-h" being inadvertently caught by tf.app.run().