@@ -56,6 +56,8 @@ def __init__(self, map_name, resolution, size_in_gb, **kwargs):
56
56
super (StarcraftVideoConfig , self ).__init__ (
57
57
version = tfds .core .Version (
58
58
"0.1.2" , experiments = {tfds .core .Experiment .S3 : False }),
59
+ supported_versions = [tfds .core .Version (
60
+ "1.0.0" , "New split API (https://tensorflow.org/datasets/splits)" )],
59
61
** kwargs )
60
62
self .map_name = map_name
61
63
self .resolution = resolution
@@ -205,17 +207,19 @@ def _parse_single_video(self, example_proto):
205
207
def _generate_examples (self , files ):
206
208
logging .info ("Reading data from %s." , "," .join (files ))
207
209
with tf .Graph ().as_default ():
208
- ds = tf .data .TFRecordDataset (files )
210
+ ds = tf .data .TFRecordDataset (sorted ( files ) )
209
211
ds = ds .map (
210
212
self ._parse_single_video ,
211
213
num_parallel_calls = tf .data .experimental .AUTOTUNE )
212
214
iterator = tf .compat .v1 .data .make_one_shot_iterator (ds ).get_next ()
213
215
with tf .compat .v1 .Session () as sess :
214
216
sess .run (tf .compat .v1 .global_variables_initializer ())
215
217
try :
218
+ i = 0
216
219
while True :
217
220
video = sess .run (iterator )
218
- yield {"rgb_screen" : video }
221
+ yield i , {"rgb_screen" : video }
222
+ i += 1
219
223
220
224
except tf .errors .OutOfRangeError :
221
225
# End of file.
0 commit comments