-
Notifications
You must be signed in to change notification settings - Fork 45.5k
Glint everything #3654
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
Glint everything #3654
Conversation
In the interest of sharing the pain-- everyone look over the files you touched recently. |
LoggingTensorHook, ProfilerHook, ExamplesPerSecondHook, which are defined | ||
as keys in HOOKS | ||
kwargs: a dictionary of arguments to the hooks. | ||
**kwargs: a dictionary of arguments to the hooks. |
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.
This seems silly in the Args, but glint complains otherwise.
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.
Yeah, I got the same warning when glinting it . Will follow this style later. LGTM, thanks.
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.
Wow, that's a lot of lint. Thanks for cleaning all the code!
`method` and other details each time. | ||
"""Simple wrapper around tf.resize_images. | ||
This is primarily to make sure we use the same `method` and other details |
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.
nit: replace method
with ResizeMethod
official/resnet/resnet_model.py
Outdated
data_format: The input format ('channels_last' or 'channels_first'). | ||
Returns: | ||
The output tensor of the block. |
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.
- comment that the output shape should be the same as the inputs
official/mnist/dataset.py
Outdated
with tf.gfile.Open(filename, 'rb') as f: | ||
magic = read32(f) | ||
num_images = read32(f) | ||
num_images = read32(f) # pylint: disable=unused-variable |
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.
Would it be better to write this as:
read32(f) # num_images, ignored
And same for num_items
below?
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.
LGTM. Thanks!
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.
LGTM.
official/mnist/dataset.py
Outdated
with tf.gfile.Open(filename, 'rb') as f: | ||
magic = read32(f) | ||
num_items = read32(f) | ||
num_items = read32(f) # pylint: disable=unused-variable |
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 instead of put a suppression of lint here, you can just rename the variable as unused_num_items and I think it will make the code more readable, and also make the lint warning go away.
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.
Solved slightly differently, as per @asimshankar 's comments above.
ValueError: if no GPUs are found, or selected batch_size is invalid. | ||
""" | ||
from tensorflow.python.client import device_lib | ||
from tensorflow.python.client import device_lib # pylint: disable=g-import-not-at-top |
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.
Is there any reason that we have to do a local import and not put it on top?
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.
We want to hide this code, as it should not be exposed to the user, and we want to remove it as soon as it's done by Estimator directly. So, for now, leaving bundled.
from official.mnist import dataset as mnist_dataset | ||
from official.mnist import mnist | ||
from official.mnist import dataset | ||
|
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 glint will give u a snippet to paste for incorrect order, should we do that instead of put a lint suppression here?
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 problem is TF versus official; alphabetically TF should come after official, and to Google, their both the same, but for us, TF is third party.
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.
Just one nit!
official/wide_deep/wide_deep.py
Outdated
|
||
_NUM_EXAMPLES = { | ||
'train': 32561, | ||
'validation': 16281, |
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.
nit: remove extra space
I added an rcfile that we will be able to run with pylint:
|
So much linting. Please don't introduce any new lint errors after this. Tests will be updated to check as well.