-
Notifications
You must be signed in to change notification settings - Fork 186
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
Tensor size mismatch issue #309
Comments
If I change These numbers are not affected by changing the number of channels. detailed output(base) PS F:\_ircam\electromagnetic recs> rave train --config v2_small --db_path .\dataset --out_path .\model --name electron --channels 1 I0503 16:29:45.640041 12732 resource_reader.py:50] system_path_file_exists:v2_small.gin E0503 16:29:45.640041 12732 resource_reader.py:55] Path not found: v2_small.gin I0503 16:29:45.640041 12732 resource_reader.py:50] system_path_file_exists:C:\Program Files\Python311\Lib\site-packages\rave\v2_small.gin E0503 16:29:45.649347 12732 resource_reader.py:55] Path not found: C:\Program Files\Python311\Lib\site-packages\rave\v2_small.gin I0503 16:29:45.649347 12732 resource_reader.py:50] system_path_file_exists:configs/v1.gin E0503 16:29:45.649347 12732 resource_reader.py:55] Path not found: configs/v1.gin C:\Program Files\Python311\Lib\site-packages\torch\nn\utils\weight_norm.py:28: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm. warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.") train set: 2348 examples val set: 48 examples selected gpu: [] GPU available: False, used: False TPU available: False, using: 0 TPU cores IPU available: False, using: 0 IPUs HPU available: False, using: 0 HPUs| Name | Type | Params0 | pqmf | CachedPQMF | 16.7 K
|
+1, experiencing the same issue whenever I change the sampling_rate and/or num_signal/n_signal parameter. Rave version 2.3.1. |
I have the same issue even when preprocessing with the "default" parameters def validation_step(self, x, batch_idx):
z = self.encode(x)
if isinstance(self.encoder, blocks.VariationalEncoder):
mean = torch.split(z, z.shape[1] // 2, 1)[0]
else:
mean = None
z = self.encoder.reparametrize(z)[0]
y = self.decode(z)
# - - - quick and dirty attempt to fix this mismatch in the MSS loss inputs' shapes - - -
if x.shape[2] < y.shape[2]: # Crop output
warnings.warn("Cropping output y for MSS loss")
# TODO should crop the beginning instead of the end? Or center the crop?
y = y[:, :, 0:x.shape[2]]
elif x.shape[2] > y.shape[2]:
raise AssertionError("Output is shorter than input")
# - - - end of quick and dirty fix - - -
distance = self.audio_distance(x, y)
full_distance = sum(distance.values())
if self.trainer is not None:
self.log('validation', full_distance)
return torch.cat([x, y], -1), mean For instance for my dataset, before the crop, x (input) and y (output) had different lengths:
I have just started using RAVE today so I don't know if this is a proper fix. Hope this helps! |
Same problem here:
...and @gwendal-lv fix does not work. I am working with part of the Audio MNIST dataset (6500 files of 30000). Some files are pretty short so my arguments are: preprocessing rave preprocess \
--input_path $input_path \
--output_path $output_path \
--channels 1 \
--sampling_rate 48000 \
--num_signal 14400 resulting in: channels: 1
lazy: false
n_seconds: 2032.8
sr: 48000 training rave train \
--config v2_small \
--db_path $db_path \
--name $name \
--val_every 2500 \
--gpu -1 \
--channels 1 \
--n_signal 14400 \
--workers $workers tried with btw: there is no |
the problem seems to be related with the sample rate. Changing the sample the |
When running on a database after preprocessing, the following error occurs:
The size of tensor a (118) must match the size of tensor b (119) at non-singleton dimension 2
Changing the architecture from v2_small to v1 changes the number of b tensors from 119 to 121
To be honest, I'm not familiar with learning networks and can't even guess what this is about. If you have any ideas on how to solve this, any ideas would be greatly appreciated. I'm doing the training on the local machine.
I think the same issue:
#157
preprocessing
rave preprocess --channels 2 -v 1 --input_path .\ --output_path .\dataset --sampling_rate 96000
training
rave train --config v2_small --db_path .\dataset --out_path .\model --name electron --channels 2
The text was updated successfully, but these errors were encountered: