vincentherrmann / pytorch-wavenet

An implementation of WaveNet with fast generation
MIT License
968 stars 225 forks source link

keep poping error:"/pytorch/torch/csrc/autograd/python_function.cpp:638: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)" #29

Open BarCodeReader opened 4 years ago

BarCodeReader commented 4 years ago

when run the notebook, it will keep poping the error: /pytorch/torch/csrc/autograd/python_function.cpp:638: UserWarning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)

anyone counter this?

DocMorg commented 4 years ago

Me too. Trying to solve it. No results yet.

mys007 commented 4 years ago

As a workaround, one can replace https://github.com/vincentherrmann/pytorch-wavenet/blob/26ba28989edcf8688f6216057aafda07601ff07e/wavenet_modules.py#L127 with

    pads = [0] * (input.ndim * 2)
    pads[2 * dimension + (1 if pad_start else 0)] = target_size - input.shape[dimension]
    return torch.nn.functional.pad(input, pads[::-1], mode='constant', value=value)
angeloyeo commented 4 years ago

The response from @mys007 works!

neko-is-kitty commented 2 years ago

Afair I tried this on a fork of this suited for pytorch 1.6 and I tried it on this repository as well, and the workaround from @mys007 doesn't work for me.

Running colab bc that's the only platform I can use rn. This is frustrating.

drewads commented 2 years ago

I'm also on colab and am having an issue with this workaround as well.