I am working on a upgrading project from Tensorflow 1.15 to 2.4.1 ( python 3.8 ). The following is the issue I am facing. I understand the issue is with tf.contrib. How do I make this work ?
if num_epochs is not None and shuffle:
dataset = dataset.apply(
tf.contrib.data.shuffle_and_repeat(buffer_size=batch_size * 10, count=num_epochs)
)
elif shuffle:
dataset = dataset.shuffle(buffer_size=batch_size * 10)
elif num_epochs is not None:
dataset = dataset.repeat(count=num_epochs)
dataset = dataset.apply(
tf.contrib.data.map_and_batch(map_func=parse_csv,
batch_size=batch_size,
num_parallel_calls=tf.data.experimental.AUTOTUNE)
)
I have another block below
distribution_strategy = tf.contrib.distribute.MirroredStrategy(num_gpus=num_gpus,
prefetch_on_device=True,
auto_shard_dataset=True)
How do I achieve the same in Tensorflow 2.4.1