padding_mode
defaults to "reflect" causes Exception when input
's time_length
is smaller than half of kernel size.
#2284
Labels
bug
Something isn't working
Describe the bug
A "reflect" padding mode tries to copy half of kernel size numbers of frames from the input,
It fails when
input
'stime_length
is smaller than half of kernel size.It happens when I create a
speechbrain.lobes.models.transformer.Transformer.TransformerEncoder
withffn_type=1dcnn
withffn_cnn_kernel_size_list=[5,5]
. If the input has only one time frame, the error happens. By the way, the input for me is phoneme sequence, it is definitely a legal input to having only one phoneme.Sorry that I can't provide a detailed stack traceback be cause I can't access company network now, and I hope the discription is clear enough.
Maybe it's safer to make
Conv1D
havingpadding_mode='zeros'
?Or, perhaps in this special case, fallback to
replicate
mode, and leaving legacy codes/models unaffected?Expected behaviour
CNN1D works out-of-box for the special case when
input
'stime_length
is smaller than half of kernel size.To Reproduce
No response
Environment Details
No response
Relevant Log Output
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: