Pass file object instead of non-supported URL string to np.load
Browse files
fashion_mnist_corrupted.py
CHANGED
@@ -117,8 +117,10 @@ class FashionMnistCorrupted(datasets.GeneratorBasedBuilder):
|
|
117 |
def _generate_examples(self, filepath, split):
|
118 |
"""This function returns the examples in the raw form."""
|
119 |
# Images
|
120 |
-
|
121 |
-
|
|
|
|
|
122 |
|
123 |
if images.shape[0] != labels.shape[0]:
|
124 |
raise ValueError(
|
|
|
117 |
def _generate_examples(self, filepath, split):
|
118 |
"""This function returns the examples in the raw form."""
|
119 |
# Images
|
120 |
+
with open(filepath[0], "rb") as f:
|
121 |
+
images = np.load(f)
|
122 |
+
with open(filepath[1], "rb") as f:
|
123 |
+
labels = np.load(f)
|
124 |
|
125 |
if images.shape[0] != labels.shape[0]:
|
126 |
raise ValueError(
|