I am running into a seemingly simple bug when trying to run the causal version of speechbrain.lobes.models.conv_tasnet.MaskNet. Simply setting the 'causal' flag to True triggers this error: TypeError: bad operand type for unary -: 'str'.
I expect that simply changing the flag allows switching between the causal and acausal implementations.
from speechbrain.lobes.models.conv_tasnet import MaskNet
hprams = {'N': 64, 'B': 32, 'H': 64, 'P': 3, 'X': 6, 'R': 3, 'C': 1}
acausal_net = MaskNet(**hparams, causal=False)
# -> defines network
causal_net = MaskNet(**hparams, causal=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/lobes/models/conv_tasnet.py", line 238, in __init__
self.temporal_conv_net = TemporalBlocksSequential(
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/lobes/models/conv_tasnet.py", line 160, in __init__
self.append(
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/nnet/containers.py", line 112, in append
layer = layer(*args, input_shape=input_shape, **kwargs)
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/lobes/models/conv_tasnet.py", line 346, in __init__
self.layers.append(
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/nnet/containers.py", line 112, in append
layer = layer(*args, input_shape=input_shape, **kwargs)
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/lobes/models/conv_tasnet.py", line 443, in __init__
self.append(
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/nnet/containers.py", line 111, in append
input_shape = self.get_output_shape()
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/nnet/containers.py", line 132, in get_output_shape
dummy_output = self(dummy_input)
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/nnet/containers.py", line 144, in forward
x = layer(x)
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ALABSAD/aloradad/anaconda3/envs/se/lib/python3.8/site-packages/speechbrain/lobes/models/conv_tasnet.py", line 487, in forward
return x[:, : -self.chomp_size, :].contiguous()
TypeError: bad operand type for unary -: 'str'
The error simply says that it can not negate a string. This string is self.chomp_size, which turns out have the value 'same' when causal=True
I am using speechbrain version 0.5.12.
Description
Hi everyone,
I am running into a seemingly simple bug when trying to run the causal version of speechbrain.lobes.models.conv_tasnet.MaskNet. Simply setting the 'causal' flag to True triggers this error: TypeError: bad operand type for unary -: 'str'.
Expected behaviour
I expect that simply changing the flag allows switching between the causal and acausal implementations.
To Reproduce
Here is a minimal example:
The error simply says that it can not negate a string. This string is self.chomp_size, which turns out have the value 'same' when causal=True
Versions
I am using speechbrain version 0.5.12.