From 84e0ea2342f6f420eadc6aa0797022ba4e84c869 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Tue, 2 Mar 2021 03:17:09 +0000 Subject: [PATCH] fix ci and import --- deepspeech/decoders/tests/test_decoders.py | 2 +- deepspeech/exps/deepspeech2/config.py | 2 +- deepspeech/exps/deepspeech2/model.py | 2 +- deepspeech/models/deepspeech2.py | 4 ++-- deepspeech/modules/rnn.py | 1 + deepspeech/training/gradclip.py | 1 + 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/deepspeech/decoders/tests/test_decoders.py b/deepspeech/decoders/tests/test_decoders.py index 9c4b1c8eb..e225d2bc1 100644 --- a/deepspeech/decoders/tests/test_decoders.py +++ b/deepspeech/decoders/tests/test_decoders.py @@ -14,7 +14,7 @@ """Test decoders.""" import unittest -from decoders import decoders_deprecated as decoder +from deepspeech.decoders import decoders_deprecated as decoder class TestDecoders(unittest.TestCase): diff --git a/deepspeech/exps/deepspeech2/config.py b/deepspeech/exps/deepspeech2/config.py index af635a68d..968899d75 100644 --- a/deepspeech/exps/deepspeech2/config.py +++ b/deepspeech/exps/deepspeech2/config.py @@ -13,7 +13,7 @@ # limitations under the License. from yacs.config import CfgNode as CN -from deepspeech.models.DeepSpeech2 import DeepSpeech2Model +from deepspeech.models.deepspeech2 import DeepSpeech2Model _C = CN() _C.data = CN( diff --git a/deepspeech/exps/deepspeech2/model.py b/deepspeech/exps/deepspeech2/model.py index 6f1d90ca8..32d4387b3 100644 --- a/deepspeech/exps/deepspeech2/model.py +++ b/deepspeech/exps/deepspeech2/model.py @@ -44,7 +44,7 @@ from deepspeech.io.sampler import SortagradBatchSampler from deepspeech.io.dataset import ManifestDataset from deepspeech.training.loss import CTCLoss -from deepspeech.models.DeepSpeech2 import DeepSpeech2Model +from deepspeech.models.deepspeech2 import DeepSpeech2Model logger = logging.getLogger(__name__) diff --git a/deepspeech/models/deepspeech2.py b/deepspeech/models/deepspeech2.py index 4a746195d..31a7f5588 100644 --- a/deepspeech/models/deepspeech2.py +++ b/deepspeech/models/deepspeech2.py @@ -25,7 +25,7 @@ from paddle.nn import functional as F from paddle.nn import initializer as I from deepspeech.modules.conv import ConvStack -from deepspeech.modules.conv import RNNStack +from deepspeech.modules.rnn import RNNStack from deepspeech.modules.mask import sequence_mask from deepspeech.modules.activation import brelu from deepspeech.utils import checkpoint @@ -79,7 +79,7 @@ class DeepSpeech2Model(nn.Layer): share_rnn_weights=True #Whether to share input-hidden weights between forward and backward directional RNNs.Notice that for GRU, weight sharing is not supported. )) if config is not None: - config.model.merge_from_other_cfg(default) + config.merge_from_other_cfg(default) return default def __init__(self, diff --git a/deepspeech/modules/rnn.py b/deepspeech/modules/rnn.py index 8902fae13..3cb8c7d05 100644 --- a/deepspeech/modules/rnn.py +++ b/deepspeech/modules/rnn.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import math import logging import paddle diff --git a/deepspeech/training/gradclip.py b/deepspeech/training/gradclip.py index 7292d7a21..1693b76df 100644 --- a/deepspeech/training/gradclip.py +++ b/deepspeech/training/gradclip.py @@ -14,6 +14,7 @@ import logging +import paddle from paddle.fluid.dygraph import base as imperative_base from paddle.fluid import layers from paddle.fluid import core