Giter Site home page Giter Site logo

kaituoxu / tasnet Goto Github PK

View Code? Open in Web Editor NEW
106.0 5.0 31.0 1.18 MB

A PyTorch implementation of Time-domain Audio Separation Network (TasNet) with Permutation Invariant Training (PIT) for speech separation.

Shell 10.55% Python 52.33% Makefile 0.44% Perl 36.69%
speech-separation source-separation audio-separation pit pytorch tasnet permutation-invariant-training

tasnet's Issues

当菜鸟(我)使用高版本torch时,遇到的需要注意的地方 Problems I have met when I using high version torch

  1. TypeError: lstm() received an invalid combination of arguments:
    https://blog.csdn.net/yhoon0101/article/details/131649166
    修改代码为:(line 37 in train.py)
    parser.add_argument('--bidirectional', default=True, type=bool, help='Whether use bidirectional LSTM')

  2. RuntimeError: ‘lengths‘ argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor:
    https://blog.csdn.net/weixin_45084253/article/details/122269699
    修改代码为:(line 179 in solver.py)
    estimate_source = self.model(padded_mixture, mixture_lengths.to("cpu"))

我升级为高版本torch是因为遇到runtimeerror: cudnn error: cudnn_status_mapping_error错误,我的原因是因为torch版本和cuda版本不太兼容

didn't match because some of the arguments have invalid types: (Tensor, Tensor, !tuple!, !list!, bool, int, int, bool, !int!)

Hello, thanks for sharing your code. I'm very interested in the project. But while running the project, I encountered a problem:

Training...
Traceback (most recent call last):
  File "~/TasNet/egs/wsj0/../../src/train.py", line 125, in <module>
    main(args)
  File "~/TasNet/egs/wsj0/../../src/train.py", line 119, in main
    solver.train()
  File "~/TasNet/src/solver.py", line 75, in train
    tr_avg_loss = self._run_one_epoch(epoch)
  File "~/TasNet/src/solver.py", line 174, in _run_one_epoch
    estimate_source = self.model(padded_mixture, mixture_lengths)
  File "~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "~/TasNetsrc/tasnet.py", line 36, in forward
    est_mask = self.separator(mixture_w, mixture_lengths)
  File "~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "~/TasNet/src/tasnet.py", line 155, in forward
    packed_output, hidden = self.rnn(packed_input)
  File "~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 182, in forward
    self.num_layers, self.dropout, self.training, self.bidirectional)
TypeError: lstm() received an invalid combination of arguments - got (Tensor, Tensor, tuple, list, bool, int, int, bool, int), but expected one of:
 * (Tensor data, Tensor batch_sizes, tuple of Tensors hx, tuple of Tensors params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional)
      didn't match because some of the arguments have invalid types: (Tensor, Tensor, !tuple!, !list!, bool, int, int, bool, !int!)
 * (Tensor input, tuple of Tensors hx, tuple of Tensors params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, bool batch_first)
      didn't match because some of the arguments have invalid types: (Tensor, !Tensor!, !tuple!, !list!, !bool!, int, !int!, bool, !int!)

请问您有遇到过这个问题吗?谢谢

您好!想问一下这个是什么错误,不太会

Traceback (most recent call last):
File "G:/speech_code/TasNet/src/train.py", line 56, in
main(ts)
File "G:/speech_code/TasNet/src/train.py", line 52, in main
solver.train()
File "G:\speech_code\TasNet\src\solver.py", line 75, in train
tr_avg_loss = self._run_one_epoch(epoch)
File "G:\speech_code\TasNet\src\solver.py", line 176, in _run_one_epoch
estimate_source = self.model(padded_mixture, mixture_lengths)
File "D:\Users\15229\anaconda3\envs\speech\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "G:\speech_code\TasNet\src\tasnet.py", line 37, in forward
est_mask = self.separator(mixture_w, mixture_lengths)
File "D:\Users\15229\anaconda3\envs\speech\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "G:\speech_code\TasNet\src\tasnet.py", line 162, in forward
packed_output, hidden = self.rnn(packed_input)
File "D:\Users\15229\anaconda3\envs\speech\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\Users\15229\anaconda3\envs\speech\lib\site-packages\torch\nn\modules\rnn.py", line 664, in forward
result = _VF.lstm(input, batch_sizes, hx, self._flat_weights, self.bias,
TypeError: lstm() received an invalid combination of arguments - got (Tensor, Tensor, tuple, list, bool, int, float, bool, int), but expected one of:

  • (Tensor data, Tensor batch_sizes, tuple of Tensors hx, tuple of Tensors params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional)
    didn't match because some of the arguments have invalid types: (Tensor, Tensor, !tuple!, !list!, bool, int, float, bool, !int!)
  • (Tensor input, tuple of Tensors hx, tuple of Tensors params, bool has_biases, int num_layers, float dropout, bool train, bool bidirectional, bool batch_first)
    didn't match because some of the arguments have invalid types: (Tensor, !Tensor!, !tuple!, !list!, !bool!, int, !float!, bool, !int!)

loss becomes negative

What loss function is used and why the loss becomes negative?
Thanks for your nice code.

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.