Skip to content

Commit ba46b47

Browse files
authored
Merge pull request #545 from tts-nlp/master
bugs fixed for tf 2.4.1 training
2 parents 31e446a + 0d94f76 commit ba46b47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/melgan/audio_mel_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def __init__(
3838
mel_length_threshold=0,
3939
):
4040
"""Initialize dataset.
41-
4241
Args:
4342
root_dir (str): Root directory including dumped files.
4443
audio_query (str): Query to find audio files in root_dir.
@@ -48,7 +47,6 @@ def __init__(
4847
audio_length_threshold (int): Threshold to remove short audio files.
4948
mel_length_threshold (int): Threshold to remove short feature files.
5049
return_utt_id (bool): Whether to return the utterance id with arrays.
51-
5250
"""
5351
# find all of audio and mel files.
5452
audio_files = sorted(find_files(root_dir, audio_query))
@@ -117,7 +115,9 @@ def create(
117115
datasets = tf.data.Dataset.from_generator(
118116
self.generator, output_types=output_types, args=(self.get_args())
119117
)
120-
118+
options = tf.data.Options()
119+
options.experimental_distribute.auto_shard_policy = tf.data.experimental.AutoShardPolicy.OFF
120+
datasets = datasets.with_options(options)
121121
# load dataset
122122
datasets = datasets.map(
123123
lambda items: self._load_data(items), tf.data.experimental.AUTOTUNE

0 commit comments

Comments
 (0)