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

about train_rnn.py #49

Open
Wangfighting0015 opened this issue Jun 9, 2022 · 1 comment
Open

about train_rnn.py #49

Wangfighting0015 opened this issue Jun 9, 2022 · 1 comment

Comments

@Wangfighting0015
Copy link

学长好,我在运行您的DPRNN的时候,运行python train_rnn.py --opt config/Dual_RNN/train_rnn.yml时,不知道为什么一直报下面的错,不知道为什么:
22-06-09 16:31:20 [train_rnn.py:69 - INFO ] Building the model of Dual-Path-RNN
22-06-09 16:31:20 [train_rnn.py:72 - INFO ] Building the optimizer of Dual-Path-RNN
22-06-09 16:31:20 [train_rnn.py:76 - INFO ] Building the dataloader of Dual-Path-RNN
22-06-09 16:34:34 [train_rnn.py:81 - INFO ] Train Datasets Length: 27698, Val Datasets Length: 7004
22-06-09 16:34:34 [train_rnn.py:90 - INFO ] Building the Trainer of Dual-Path-RNN
22-06-09 16:34:34 [/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/trainer/trainer_Dual_RNN.py:35 - INFO ] Load Nvida GPU .....
22-06-09 16:34:43 [/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/trainer/trainer_Dual_RNN.py:41 - INFO ] Loading Dual-Path-RNN parameters: 2.634 Mb
22-06-09 16:34:43 [/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/trainer/trainer_Dual_RNN.py:69 - INFO ] Gradient clipping by 5, default L2
22-06-09 16:34:43 [/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/trainer/trainer_Dual_RNN.py:116 - INFO ] Start Validation from epoch: 0, iter: 0
Traceback (most recent call last):
File "train_rnn.py", line 96, in
train()
File "train_rnn.py", line 92, in train
trainer.run()
File "/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/trainer/trainer_Dual_RNN.py", line 162, in run
v_loss = self.validation(self.cur_epoch)
File "/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/trainer/trainer_Dual_RNN.py", line 135, in validation
out = torch.nn.parallel.data_parallel(self.dualrnn,mix,device_ids=self.gpuid)
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 207, in data_parallel
return module(*inputs[0], **module_kwargs[0])
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/model/model_rnn.py", line 404, in forward
s = self.separation(e)
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/model/model_rnn.py", line 289, in forward
x = self.dual_rnni
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/wangtt/wttpython_project/Dual-Path-RNN-Pytorch-master/model/model_rnn.py", line 207, in forward
intra_rnn = self.intra_norm(intra_rnn)
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 100, in forward
self._check_input_dim(input)
File "/home/wangtt/anaconda3/envs/Dual_path_RNN_Sepatation/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 207, in _check_input_dim
.format(input.dim()))
ValueError: expected 2D or 3D input (got 4D input)

@JusperLee
Copy link
Owner

这个应该是你输入的特征维度应该把batch和segment number放在一起

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