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

RuntimeError: Callculated padded input size per channel: (2×42). Kernel size: (3×3). Kernel size can't be greater than actual input size #48

Open
xzwworkplace opened this issue Oct 9, 2021 · 3 comments

Comments

@xzwworkplace
Copy link

我在跑conformer的时候遇到了这个问题。

`Traceback (most recent call last):
File "run.py", line 134, in
main(cmd_args, params, expdir)
File "run.py", line 72, in main
main(cmd_args, params, expdir)
File "run.py", line 72, in main
trainer.train(train_loader=train_loader)
File "/media/shiyanshi/E/2021_XZW/OpenTransformer/otrans/train/trainer.py", line 90, in train
train_loss = self.train_one_epoch(epoch, train_loader.loader)
File "/media/shiyanshi/E/2021_XZW/OpenTransformer/otrans/train/trainer.py", line 152, in train_one_epoch
loss, aux_loss = self.model(inputs, targets)
File "/home/shiyanshi/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/media/shiyanshi/E/2021_XZW/OpenTransformer/otrans/model/speech2text.py", line 47, in forward
enc_inputs, enc_mask = self.frontend(enc_inputs, enc_mask)
File "/home/shiyanshi/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/media/shiyanshi/E/2021_XZW/OpenTransformer/otrans/frontend/conv.py", line 142, in forward
x, mask = self.conv2(x, mask)
File "/home/shiyanshi/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/media/shiyanshi/E/2021_XZW/OpenTransformer/otrans/frontend/conv.py", line 63, in forward
out = self.conv_layer(x)
File "/home/shiyanshi/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/shiyanshi/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 349, in forward
return self._conv_forward(input, self.weight)
File "/home/shiyanshi/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 346, in _conv_forward
self.padding, self.dilation, self.groups)
RuntimeError: Calculated padded input size per channel: (2 x 42). Kernel size: (3 x 3). Kernel size can't be greater than actual input size

`

请问下,怎么修改呀。

@xzwworkplace
Copy link
Author

这是因为数据的问题吗,我跑aishell没有出这个问题,但是用自己的数据就出现这个问题了。

@ZhengkunTian
Copy link
Owner

这个可能是你数据比较短造成的,建议先把数据过一遍,看看长度是否有问题

@xzwworkplace
Copy link
Author

xzwworkplace commented Oct 13, 2021 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