Git Product home page Git Product logo

Comments (4)

hirofumi0810 avatar hirofumi0810 commented on August 22, 2024

@Nakachi-S Yes. If you want to use cold/deep fusions, you have to stop at stage-3 once.
This is because the LM directory name is defined in python scripts.

from neural_sp.

Nakachi-S avatar Nakachi-S commented on August 22, 2024

@hirofumi0810 Thank you for reply!
I resumed ASR training as you suggest, specifying the language model from stage 4.
(The added options, which are Lm_fusion and external_lm, are described above comment .)

Learning the first epoch works well.
But then, the following error occurs during the evaluation.

100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉| 370180/370189 [3:41:03<00:01,  5.61it/s]Traceback (most recent call last):
  File "/home/jupyter-nakachi-s/neural_sp/examples/csj/s5/../../../neural_sp/bin/asr/train.py", line 529, in <module>
    save_path = pr.runcall(main)
  File "/opt/tljh/user/envs/ncr_env/lib/python3.7/cProfile.py", line 121, in runcall
    return func(*args, **kw)
  File "/home/jupyter-nakachi-s/neural_sp/examples/csj/s5/../../../neural_sp/bin/asr/train.py", line 424, in main
    optimizer.n_epochs + 1, logger)
  File "/home/jupyter-nakachi-s/neural_sp/examples/csj/s5/../../../neural_sp/bin/asr/train.py", line 481, in evaluate
    metric, cer = eval_wordpiece(models, dataset, recog_params, epoch=epoch)
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/evaluators/wordpiece.py", line 82, in eval_wordpiece
    ensemble_models=models[1:] if len(models) > 1 else [])
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/models/seq2seq/speech2text.py", line 707, in decode
    exclude_eos, refs_id, utt_ids, speakers)
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/models/seq2seq/decoders/las.py", line 911, in greedy
    lmout, lmstate = self.lm.decode(self.lm(y), lmstate)
  File "/home/jupyter-nakachi-s/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/models/lm/lm_base.py", line 62, in forward
    loss, state, observation = self._forward(ys, state)
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/models/lm/lm_base.py", line 66, in _forward
    ys = [np2tensor(y, self.device_id) for y in ys]  # <eos> is included
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/models/lm/lm_base.py", line 66, in <listcomp>
    ys = [np2tensor(y, self.device_id) for y in ys]  # <eos> is included
  File "/home/jupyter-nakachi-s/neural_sp/neural_sp/models/torch_utils.py", line 49, in np2tensor
    tensor = torch.from_numpy(array)
TypeError: expected np.ndarray (got Tensor)

Have ever seen like this error?

from neural_sp.

hirofumi0810 avatar hirofumi0810 commented on August 22, 2024

@Nakachi-S Thank you for your report. I fixed this in #87.
Please try the latest code.

from neural_sp.

Nakachi-S avatar Nakachi-S commented on August 22, 2024

It works!!!
Thank you your help!

from neural_sp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.