From 16ee615e1f7ce17f62c52f60e81e7ab01392dc35 Mon Sep 17 00:00:00 2001 From: XIAO Yixuan Date: Tue, 12 Mar 2019 13:58:40 +0800 Subject: [PATCH 1/2] [scripts] Removed import __future__ and fixed a bug in merge_targets.py when using python3 --- egs/wsj/s5/steps/segmentation/internal/merge_targets.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/egs/wsj/s5/steps/segmentation/internal/merge_targets.py b/egs/wsj/s5/steps/segmentation/internal/merge_targets.py index a14aef151c2..e886fdac643 100755 --- a/egs/wsj/s5/steps/segmentation/internal/merge_targets.py +++ b/egs/wsj/s5/steps/segmentation/internal/merge_targets.py @@ -16,8 +16,6 @@ option. """ -from __future__ import print_function -from __future__ import division import argparse import logging import numpy as np @@ -111,7 +109,7 @@ def should_remove_frame(row, dim): # source[2] = [ 0 0 0 ] """ assert len(row) % dim == 0 - num_sources = len(row) / dim + num_sources = len(row) // dim max_idx = np.argmax(row) max_val = row[max_idx] From e1c8f9b9af21a0a57e0f0d31a26fcae1a44ebf0c Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Tue, 12 Mar 2019 14:29:28 -0400 Subject: [PATCH 2/2] Update merge_targets.py --- egs/wsj/s5/steps/segmentation/internal/merge_targets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/wsj/s5/steps/segmentation/internal/merge_targets.py b/egs/wsj/s5/steps/segmentation/internal/merge_targets.py index e886fdac643..84b0c884f45 100755 --- a/egs/wsj/s5/steps/segmentation/internal/merge_targets.py +++ b/egs/wsj/s5/steps/segmentation/internal/merge_targets.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2017 Vimal Manohar # Apache 2.0