lmnt-com / diffwave

DiffWave is a fast, high-quality neural vocoder and waveform synthesizer.
Apache License 2.0
767 stars 112 forks source link

torchaudio.__version__ check fails when version >= '0.10' and < '1.0' #30

Closed xvdp closed 2 years ago

xvdp commented 2 years ago

FYI: if torchaudio.__version__ > '0.7.0': which you call in dataset.py does not check versioning properly, 0.11.0; will return False

Until recent python one could use distutils.LooseVersion but that has been deprecated ( i think it was python 3.8 or so) The proper way of checking version currently is using packaging

from packaging import version
if version.parse(torchaudio.__version__) > version.parse("0.7.0"):

Also I noticed that on same file you check if num_workers=os.cpu_count You may want to fix it to if num_workers=os.cpu_count//3 or so. After that using cpus in python gives you diminishing returns, may even be slower. You may want to verify that but at some point I tested that.

sharvil commented 2 years ago

I'm leaving the CPU count as-is; it really depends on the machine.

I've bumped up the requirement to torchaudio 0.9.0 and removed the version checks. Those checks shouldn't have been there in the first place considering setup.py had a pinned requirement on torchaudio 0.7.0.