awni / speech

A PyTorch Implementation of End-to-End Models for Speech-to-Text
Apache License 2.0
751 stars 176 forks source link

Pytest FAILURES #39

Open my-yy opened 6 years ago

my-yy commented 6 years ago

When I do pytest, I got this error: 'CTC' object has no attribute '_modules' (The details are shown at the bottom.) Is there something changed in the 'speech/models' folder? I used the old folder (I cloned about two month ago) to replace the current one, and the pytest passed.

=========================================================================================== FAILURES ============================================================================================ ____ test_ctcmodel ____

def test_ctc_model():
    freq_dim = 40
    vocab_size = 10

    batch = shared.gen_fake_data(freq_dim, vocab_size)
    batch_size = len(batch[0])
  model = CTC(freq_dim, vocab_size, shared.model_config)

ctc_test.py:16:


self = <[AttributeError("'CTC' object has no attribute '_modules'") raised in repr()] SafeRepr object at 0x107f3a5f0>, freq_dim = 40, output_dim = 10 config = {'dropout': 0.0, 'encoder': {'conv': [[32, 5, 32, 2]], 'rnn': {'bidirectional': False, 'dim': 16, 'layers': 1}}}

def __init__(self, freq_dim, output_dim, config):
  super().__init__(freq_dim, config)

E TypeError: super() takes at least 1 argument (0 given)

../speech/models/ctc_model.py:15: TypeError ___ test_save ___

def test_save():

    freq_dim = 120
    model = speech.models.Model(freq_dim,
                  shared.model_config)

io_test.py:12:


self = <[AttributeError("'Model' object has no attribute '_modules'") raised in repr()] SafeRepr object at 0x107f4c170>, input_dim = 120 config = {'dropout': 0.0, 'encoder': {'conv': [[32, 5, 32, 2]], 'rnn': {'bidirectional': False, 'dim': 16, 'layers': 1}}}

def __init__(self, input_dim, config):
  super().__init__()

E TypeError: super() takes at least 1 argument (0 given)

../speech/models/model.py:13: TypeError __ test_model ___

def test_model():
    time_steps = 100
    freq_dim = 40
    batch_size = 4
  model = speech.models.Model(freq_dim, shared.model_config)

model_test.py:15:


self = <[AttributeError("'Model' object has no attribute '_modules'") raised in repr()] SafeRepr object at 0x107f73f80>, input_dim = 40 config = {'dropout': 0.0, 'encoder': {'conv': [[32, 5, 32, 2]], 'rnn': {'bidirectional': False, 'dim': 16, 'layers': 1}}}

def __init__(self, input_dim, config):
  super().__init__()

E TypeError: super() takes at least 1 argument (0 given)

../speech/models/model.py:13: TypeError __ test_model ___

def test_model():
    freq_dim = 120
    vocab_size = 10

    np.random.seed(1337)
    torch.manual_seed(1337)

    conf = shared.model_config
    rnn_dim = conf['encoder']['rnn']['dim']
    conf["decoder"] = {"embedding_dim" : rnn_dim,
                       "layers" : 2}
  model = Seq2Seq(freq_dim, vocab_size + 1, conf)

seq2seq_test.py:21:


self = <[AttributeError("'Seq2Seq' object has no attribute '_modules'") raised in repr()] SafeRepr object at 0x107f45758>, freq_dim = 120, vocab_size = 11 config = {'decoder': {'embedding_dim': 16, 'layers': 2}, 'dropout': 0.0, 'encoder': {'conv': [[32, 5, 32, 2]], 'rnn': {'bidirectional': False, 'dim': 16, 'layers': 1}}}

def __init__(self, freq_dim, vocab_size, config):
  super().__init__(freq_dim, config)

E TypeError: super() takes at least 1 argument (0 given)

../speech/models/seq2seq.py:17: TypeError ============================================================================== 4 failed, 5 passed in 0.79 seconds ===============================================================================