Skip to content

Commit

Permalink
✍️ update base runner and dataset for empty eval dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
nglehuy committed Mar 17, 2021
1 parent fa85aa1 commit 283d1f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/conformer/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ speech_config:
normalize_per_feature: False

decoder_config:
vocabulary: ./vocabularies/librispeech/librispeech_train_4_1030.subwords
vocabulary: null
target_vocab_size: 4096
max_subword_length: 4
blank_at_zero: True
Expand Down Expand Up @@ -74,7 +74,7 @@ learning_config:
num_masks: 1
mask_factor: 27
data_paths:
- /media/nlhuy/Data/ML/Datasets/ASR/Raw/LibriSpeech/train-clean-100/transcripts.tsv
- /mnt/Data/ML/Datasets/ASR/Raw/LibriSpeech/train-clean-100/transcripts.tsv
tfrecords_dir: /mnt/Miscellanea/Datasets/Speech/LibriSpeech/tfrecords
shuffle: True
cache: True
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setuptools.setup(
name="TensorFlowASR",
version="0.8.0",
version="0.8.1",
author="Huy Le Nguyen",
author_email="[email protected]",
description="Almost State-of-the-art Automatic Speech Recognition using Tensorflow 2",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_asr/datasets/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self,
use_tf: bool = False,
stage: str = "train",
**kwargs):
self.data_paths = data_paths
self.data_paths = data_paths or []
self.augmentations = augmentations # apply augmentation
self.cache = cache # whether to cache WHOLE transformed dataset to memory
self.shuffle = shuffle # whether to shuffle tf.data.Dataset
Expand Down
5 changes: 4 additions & 1 deletion tensorflow_asr/runners/base_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def set_eval_data_loader(self, eval_dataset, eval_bs=None):
return
if not eval_bs: eval_bs = self.config.batch_size
self.eval_data = eval_dataset.create(eval_bs * self.strategy.num_replicas_in_sync)
self.eval_data_loader = self.strategy.experimental_distribute_dataset(self.eval_data)
if self.eval_data is None:
self.eval_data_loader = None
else:
self.eval_data_loader = self.strategy.experimental_distribute_dataset(self.eval_data)
self.eval_steps_per_epoch = eval_dataset.total_steps

# -------------------------------- CHECKPOINTS -------------------------------------
Expand Down

0 comments on commit 283d1f2

Please sign in to comment.