Skip to content

Commit f2a9792

Browse files
committed
Added dataset_shuffle and removed commented out os.rm commands
1 parent 6cf28e0 commit f2a9792

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/vision/nl_image_search.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
)
8585
with zipfile.ZipFile(annotation_zip, "r") as zip_ref:
8686
zip_ref.extractall(annotations_dir)
87-
# os.remove(os.path.join(root_dir,"captions.zip"))
8887

8988
print("\nDownloading the images.")
9089

@@ -93,7 +92,6 @@
9392
print("Downloaded the images.\nunzipping")
9493
with zipfile.ZipFile(image_zip, "r") as zip_ref:
9594
zip_ref.extractall(images_dir)
96-
# os.remove(os.path.join(root_dir,"train2014.zip"))
9795

9896
print("\nDataset is downloaded and extracted successfully.")
9997

@@ -251,6 +249,7 @@ def get_dataset(file_pattern, batch_size):
251249
num_parallel_calls=tf.data.AUTOTUNE,
252250
deterministic=False,
253251
)
252+
.shuffle(batch_size * 10)
254253
.batch(batch_size)
255254
.prefetch(tf.data.AUTOTUNE)
256255
)

0 commit comments

Comments
 (0)