Skip to content
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

Fix the Cifar10ImagePreprocessor class to use newer dataset APIs #320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chandanjc
Copy link

This is regarding the issue #313.

Copy link
Member

@reedwm reedwm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Sorry for the very late response.

capacity=min_queue_examples + 3 * self.batch_size,
min_after_dequeue=min_queue_examples)

dataset_train = dataset_train.shuffle(min_queue_examples).batch(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should call .repeat() in between shuffle and batch

dataset_train = dataset_train.shuffle(min_queue_examples).batch(
self.batch_size, drop_remainder=True)

if tf.VERSION > "1.12":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can safely assume TensorFlow is at least version 1.12. There are branches such as cnn_tf_v1.11_compatible that work with older versions.

self.batch_size, drop_remainder=True)

if tf.VERSION > "1.12":
raw_images, raw_labels = tf.compat.v1.data.make_one_shot_iterator(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for compat.v1 since we have import tensorflow.compat.v1 as tf at the top. Simply tf.data.make_one_shot_iterator is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants