mlp_expansion_facfor
You probably use outdated codebase for Linux or old UVR version incompatible with some newer Roformers like the SW.
We have some workarounds for it, but at least below not confirmed to work so far:
"The first issue is that the BS Roformer implementation in UVR5 does not accept the mlp_expansion_factor parameter.
>If mlp_expansion_factor is set to 4 in the [yaml] config file, simply remove that line.” - anvuew
And then the second issue might occur:
"The size of tensor a (484864) must match the size of tensor b (485100) at non-singleton dimension 2"
Regarding the second issue, chunk_size should be a multiple of stft_hop_length." - anvuew
Q: Hop is 512 and chunk is 588800.
That's a ratio of 1150.
A: Then you need to find out where this 485100 comes from.
[And they didn't, although in some other case, it stopped appearing also after fixing the error below and deleting
use_torch_checkpointing line too]
The issue also exists in the old MSST versions on which Colabs are based on, so from before refactoring of the MSST code. Fixed model_utils.py like below:
= model(arr)
# The fix:
if x.shape[-1] != arr.shape[-1]:
# If the dimensions do not match, trim or fill x to size arr
import torch.nn.functional as F
diff = arr.shape[-1] - x.shape[-1]
if diff > 0:
x = F.pad(x, (0, diff)) # Pad with zeros if too short
else:
x = x[..., :arr.shape[-1]] # Trim if too long
In mdx23c_tfc_tdf_v3.py (fixed) also padding was fixed before, but IDK if it was necessary:
res = encoder_outputs.pop()
if x.shape[2:] != res.shape[2:]:
import torch.nn.functional as F
x = F.interpolate(x, size=res.shape[2:], mode='bilinear', align_corners=True)
x = torch.cat([x, res], 1)
Or alternatively “I've added a length constraint to the inverse stft function as additional safe guard for small shape mismatch (which is not present in ZF's MSST repo version or original mdx23c code). It will not help with wrong chunk_size values but maybe help with these "randomly" happening issues.” - jarredou