Skip to content

Commit 7c3b475

Browse files
fix: numpy load
1 parent 174c7c9 commit 7c3b475

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tensorflow_datasets/datasets/pneumoniamnist/pneumoniamnist_dataset_builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def _split_generators(self, dl_manager: tfds.download.DownloadManager):
2727

2828
path = dl_manager.download('https://zenodo.org/records/10519652/files/pneumoniamnist.npz?download=1')
2929

30-
raw_data = np.load(path, allow_pickle=True)
30+
with tf.io.gfile.GFile(path, 'rb') as f:
31+
raw_data = np.load(f, allow_pickle=True)
32+
3133
train_images = np.expand_dims(raw_data.f.train_images, axis=-1)
3234
val_images = np.expand_dims(raw_data.f.val_images, axis=-1)
3335
test_images = np.expand_dims(raw_data.f.test_images, axis=-1)

0 commit comments

Comments
 (0)