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

configuration for hop_size 256 #5

Closed
yhgon opened this issue Sep 26, 2020 · 2 comments
Closed

configuration for hop_size 256 #5

yhgon opened this issue Sep 26, 2020 · 2 comments

Comments

@yhgon
Copy link

yhgon commented Sep 26, 2020

when I configure factors for [4,4,4,2,2] to match with hop_size=256 but I could not find segment_length
Would you have idea for exactly matching segment_length to match dilation, padding for the configuration?

I got error below with segment_length=7200

Traceback (most recent call last):
  File "train.py", line 185, in <module>
    run(config, args)
  File "train.py", line 92, in run
    loss = model.compute_loss(mels, batch)
  File "/content/WaveGrad/model/diffusion_process.py", line 176, in compute_loss
    eps_recon = self.nn(mels, y_noisy, continuous_sqrt_alpha_cumprod)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/content/WaveGrad/model/nn.py", line 119, in forward
    ublock_outputs = ublock(x=ublock_outputs, scale=scale, shift=shift)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/content/WaveGrad/model/upsampling.py", line 82, in forward
    outputs = self.first_block_main_branch['modulation'](outputs, scale, shift)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/content/WaveGrad/model/upsampling.py", line 30, in forward
    outputs = self.featurewise_affine(x, scale, shift)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/content/WaveGrad/model/linear_modulation.py", line 98, in forward
    outputs = scale * x + shift
RuntimeError: The size of tensor a (450) must match the size of tensor b (448) at non-singleton dimension 2

full configuration

{
    "model_config": {
        "factors": [4,4,4,2,2],
        "upsampling_preconv_out_channels": 768,
        "upsampling_out_channels": [512, 512, 256, 128, 128],
        "upsampling_dilations": [
            [1, 2, 1, 2],
            [1, 2, 1, 2],
            [1, 2, 4, 8],
            [1, 2, 4, 8],
            [1, 2, 4, 8]
        ],
        "downsampling_preconv_out_channels": 32,
        "downsampling_out_channels": [128, 128, 256, 512],
        "downsampling_dilations": [
            [1, 2, 4], [1, 2, 4], [1, 2, 4], [1, 2, 4]
        ]
    },
    "data_config": {
        "sample_rate": 22050,
        "n_fft": 1024,
        "win_length": 1024,
        "hop_length": 256,
        "f_min": 0,
        "f_max": 8000,
        "n_mels": 80
    },

@ivanvovk
Copy link
Owner

ivanvovk commented Sep 26, 2020

Segment length maybe should match the condition segment_length % hop_length == 0. And 7200 doesn't match it. Try 7168, for example.

@yhgon
Copy link
Author

yhgon commented Sep 26, 2020

thanks for your confirm. train start well with hop_size=256 and segment_size=7200 .

@yhgon yhgon closed this as completed Sep 26, 2020
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