In tensorflow 2.8.0 using mirrored strategy:
strategy = tf.distribute.MirroredStrategy()
with strategy.scope():
self.model()
yields the following warning:
W tensorflow/core/grappler/optimizers/data/auto_shard.cc:776] AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy because of the following reason: Did not find a shardable source, walked to a node which is not a dataset: name: "FlatMapDataset/_2"
Consider either turning off auto-sharding or switching the auto_shard_policy to DATA to shard this dataset. You can do this by creating a new `tf.data.Options()` object then setting `options.experimental_distribute.auto_shard_policy = AutoShardPolicy.DATA` before applying the options object to the dataset via `dataset.with_options(options)`.
However I would like to use the FILE sharing policy, since I have multiple GPUs set up. Any ideas how I can achieve this?