From 22a164f7caa804e5ed796b3134b96f18d2307b1a Mon Sep 17 00:00:00 2001 From: thethiny Date: Sun, 30 Jun 2019 14:13:26 +0400 Subject: [PATCH] Fix Librispeech + Support Python3.6 --- examples/librispeech/config.json | 18 ++++++++++++++---- train.py | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/librispeech/config.json b/examples/librispeech/config.json index 861fc9b5..ae6bcd35 100644 --- a/examples/librispeech/config.json +++ b/examples/librispeech/config.json @@ -1,27 +1,37 @@ { - "seed" : 2017, + "seed" : 2019, "save_path" : "/deep/group/awni/speech_models/test", "data" : { "train_set" : "/deep/group/speech/datasets/LibriSpeech/train-toy.json", - "dev_set" : "/deep/group/speech/datasets/LibriSpeech/dev-toy.json" + "dev_set" : "/deep/group/speech/datasets/LibriSpeech/dev-toy.json", + "start_and_end" : false }, "optimizer" : { "batch_size" : 8, - "epochs" : 1000, + "epochs" : 200, "learning_rate" : 1e-3, "momentum" : 0.0 }, "model" : { + "class" : "Transducer", + "dropout" : 0.5, "encoder" : { + "conv" : [ + [8, 5, 32, 2], + [8, 5, 32, 1] + ], "rnn" : { "dim" : 256, - "layers" : 1 + "bidirectional" : true, + "layers" : 4 } }, "decoder" : { + "embedding_dim" : 256, + "layers" : 1 } } } diff --git a/train.py b/train.py index a04eb6c1..6bc61f3a 100644 --- a/train.py +++ b/train.py @@ -24,6 +24,7 @@ def run_epoch(model, optimizer, train_ldr, it, avg_loss): end_t = time.time() tq = tqdm.tqdm(train_ldr) for batch in tq: + batch = list(batch) start_t = time.time() optimizer.zero_grad() loss = model.loss(batch) @@ -54,6 +55,7 @@ def eval_dev(model, ldr, preproc): model.set_eval() for batch in tqdm.tqdm(ldr): + batch = list(batch) preds = model.infer(batch) loss = model.loss(batch) losses.append(loss.data[0])