Skip to content

Commit

Permalink
deleting loss and out references to prevent OOMs, fixed duration chec…
Browse files Browse the repository at this point in the history
…king for files with space in the path
  • Loading branch information
EgorLakomkin committed Jun 14, 2017
1 parent 6441435 commit 2a898d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/merge_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
file_path = files[x]
file_path = file_path.split(',')[0]
output = subprocess.check_output(
['soxi -D %s' % file_path.strip()],
['soxi -D \"%s\"' % file_path.strip()],
shell=True
)
duration = float(output)
Expand Down
2 changes: 1 addition & 1 deletion data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _order_files(file_paths):

def func(element):
output = subprocess.check_output(
['soxi -D %s' % element.strip()],
['soxi -D \"%s\"' % element.strip()],
shell=True
)
return float(output)
Expand Down
4 changes: 3 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def main():

with open(args.labels_path) as label_file:
labels = str(''.join(json.load(label_file)))

audio_conf = dict(sample_rate=args.sample_rate,
window_size=args.window_size,
window_stride=args.window_stride,
Expand Down Expand Up @@ -269,6 +268,8 @@ def main():
torch.save(DeepSpeech.serialize(model, optimizer=optimizer, epoch=epoch, iteration=i, loss_results=loss_results,
wer_results=wer_results, cer_results=cer_results, avg_loss=avg_loss),
file_path)
del loss
del out
avg_loss /= len(train_loader)

print('Training Summary Epoch: [{0}]\t'
Expand Down Expand Up @@ -309,6 +310,7 @@ def main():

if args.cuda:
torch.cuda.synchronize()
del out
wer = total_wer / len(test_loader.dataset)
cer = total_cer / len(test_loader.dataset)
wer *= 100
Expand Down

0 comments on commit 2a898d5

Please sign in to comment.