Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Evanlovea opened this issue Jun 16, 2021 · 3 comments
Open

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

Evanlovea opened this issue Jun 16, 2021 · 3 comments

Comments

@Evanlovea
Copy link

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!)
@Evanlovea
Copy link
Author

Evanlovea commented Mar 15, 2022 via email

@SsssSunhy
Copy link

把这个
model = TasNet(args.L, args.N, args.hidden_size, args.num_layers,
bidirectional=args.bidirectional, nspk=args.nspk)
改成这个
model = TasNet(args.L, args.N, args.hidden_size, args.num_layers,
bidirectional=bool(args.bidirectional), nspk=args.nspk)
就可以用了,在注意一下torch的版本,最好不要高于1.5.0

@Evanlovea
Copy link
Author

Evanlovea commented Mar 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants