mkotha / WaveRNN

A WaveRNN implementation
MIT License
198 stars 48 forks source link

if cond_input throws an error in PyTorch 1.0.1 #2

Closed kastnerkyle closed 5 years ago

kastnerkyle commented 5 years ago

There are several places in the code where you use if cond_input in the forward of some modules.

In PyTorch 1.0.1, this check tries to do a tensor evaluation so it crashes with "more than 1 element" ambiguity. My workaround was to replace with

forward(..., cond_input=None):
    if cond_input is not None:

in those places. However, this logic probably breaks the single speaker training - I'm only training multi-speaker for now. There is probably a cleaner or better way (perhaps sum(cond_input > 0) > 0), I haven't gone through the cond_input logic yet.

Thanks for the great codebase and repo

mkotha commented 5 years ago

Thank you for the report, should be fixed now.