Skip to content

Commit

Permalink
Testing normal batching
Browse files Browse the repository at this point in the history
  • Loading branch information
himat committed Apr 29, 2017
1 parent 3c02d83 commit aab2622
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions net.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_edges_file(f):
num_train_data = truth_filenames_tf.shape.as_list()[0]

truth_image_name, edges_image_name = tf.train.slice_input_producer(
[truth_filenames_tf, edges_fnames_tf], shuffle=False)
[truth_filenames_tf, edges_fnames_tf], shuffle=True)

value_truth_imgfile = tf.read_file(truth_image_name)

Expand All @@ -105,14 +105,18 @@ def get_edges_file(f):
min_queue_examples = epochs*mb_size
num_threads = 4
# Background thread to batch images
[truth_images_batch, edges_images_batch] = tf.train.shuffle_batch(
[truth_image, edges_image], # image_tensor
batch_size=mb_size,
capacity=min_queue_examples + num_threads*mb_size,
min_after_dequeue=min_queue_examples,
# shapes=([IMAGE_DIM, IMAGE_DIM, input_nc]),
num_threads=num_threads,
allow_smaller_final_batch=True)
# [truth_images_batch, edges_images_batch] = tf.train.shuffle_batch(
# [truth_image, edges_image], # image_tensor
# batch_size=mb_size,
# capacity=min_queue_examples + num_threads*mb_size,
# min_after_dequeue=min_queue_examples,
# # shapes=([IMAGE_DIM, IMAGE_DIM, input_nc]),
# num_threads=num_threads,
# allow_smaller_final_batch=True)

[truth_images_batch, edges_images_batch] = tf.train.batch(
[truth_image, edges_image],
batch_size=mb_size)

print("Batch shape ", truth_images_batch.shape)

Expand Down Expand Up @@ -184,6 +188,7 @@ def get_edges_file(f):
# Get next batch
[X_truth_batch, X_edges_batch] = sess.run([truth_images_batch,
edges_images_batch])

# print(sess.run((D_fake, D_logit_fake)))

# for j in range(3):
Expand Down

0 comments on commit aab2622

Please sign in to comment.