Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants