Skip to content

Commit f53df57

Browse files
committed
remove experimental
1 parent a9fb7be commit f53df57

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

efficientdet/dataloader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ def process_example(self, params, batch_size, images, cls_targets,
396396
@property
397397
def dataset_options(self):
398398
options = tf.data.Options()
399-
options.experimental_deterministic = self._debug or not self._is_training
400-
options.experimental_optimization.map_parallelization = True
401-
options.experimental_optimization.parallel_batch = True
399+
options.deterministic = self._debug or not self._is_training
400+
options.optimization.map_parallelization = True
401+
options.optimization.parallel_batch = True
402402
return options
403403

404404
def __call__(self, params, input_context=None, batch_size=None):

efficientnetv2/datasets.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def make_source_dataset(self, index, num_hosts):
362362
# Read the data from disk in parallel
363363
dataset = dataset.interleave(
364364
self.fetch_dataset,
365-
num_parallel_calls=tf.data.experimental.AUTOTUNE,
365+
num_parallel_calls=tf.data.AUTOTUNE,
366366
deterministic=self.debug)
367367

368368
if self.is_training and self.cache:
@@ -403,20 +403,20 @@ def _input_fn(self, batch_size, current_host, num_hosts):
403403
dataset = self.make_source_dataset(current_host, num_hosts)
404404
dataset = dataset.map(
405405
self.dataset_parser,
406-
num_parallel_calls=tf.data.experimental.AUTOTUNE).batch(
406+
num_parallel_calls=tf.data.AUTOTUNE).batch(
407407
batch_size, drop_remainder=True)
408408

409409
# Apply Mixup
410410
if self.is_training and (self.mixup_alpha or self.cutmix_alpha):
411411
dataset = dataset.map(
412412
functools.partial(self.mixing, batch_size, self.mixup_alpha,
413413
self.cutmix_alpha),
414-
num_parallel_calls=tf.data.experimental.AUTOTUNE)
414+
num_parallel_calls=tf.data.AUTOTUNE)
415415

416416
# Assign static batch size dimension
417417
dataset = dataset.map(
418418
functools.partial(self.set_shapes, batch_size),
419-
num_parallel_calls=tf.data.experimental.AUTOTUNE)
419+
num_parallel_calls=tf.data.AUTOTUNE)
420420

421421
def transpose_image(features):
422422
# NHWC -> HWCN
@@ -426,14 +426,14 @@ def transpose_image(features):
426426
if self.transpose_image:
427427
dataset = dataset.map(
428428
lambda features, labels: (transpose_image(features), labels),
429-
num_parallel_calls=tf.data.experimental.AUTOTUNE)
429+
num_parallel_calls=tf.data.AUTOTUNE)
430430

431431
# Prefetch overlaps in-feed with training
432-
dataset = dataset.prefetch(tf.data.experimental.AUTOTUNE)
432+
dataset = dataset.prefetch(tf.data.AUTOTUNE)
433433
options = tf.data.Options()
434-
options.experimental_deterministic = self.debug
435-
options.experimental_threading.max_intra_op_parallelism = 1
436-
options.experimental_threading.private_threadpool_size = 48
434+
options.deterministic = self.debug
435+
options.threading.max_intra_op_parallelism = 1
436+
options.threading.private_threadpool_size = 48
437437
dataset = dataset.with_options(options)
438438
return dataset
439439

@@ -542,7 +542,7 @@ def _input_fn(self, batch_size, current_host, num_hosts):
542542
ds = ds.repeat()
543543

544544
ds = ds.map(
545-
self.preprocess, num_parallel_calls=tf.data.experimental.AUTOTUNE)
545+
self.preprocess, num_parallel_calls=tf.data.AUTOTUNE)
546546
ds = ds.prefetch(1)
547547

548548
ds = ds.batch(batch_size, drop_remainder=True)

0 commit comments

Comments
 (0)