Closed zengchang233 closed 4 weeks ago
Thank you for reporting! I will look at it.
This is now fixed with #535
@mauvilsa Hi, thanks for fixing this bug. Could you tell me how to install the revised jsonargpase lib? I just reinstalled it on my machine via pip install "jsonargparse[all]"
but it didn't work. Should I install it from GitHub like pip install git+xxx
?
I just installed from github. Now it works!
🐛 Bug report
I would like to use CLI with config.yaml file to manage my project. But I found some classes in TorchAudio cannot be correctly parsed. The error involves importing a window function from Pytorch. For example, if the class doesn't have a window function as the argument explicitly like MFCC or LFCC, it can be parsed and imported successfully. Otherwise, it fails in parsing the class or just identifies the import path as a string (like MelSpectrogram).
To reproduce
Expected behavior
The
MelSpectrogram
class should be correctly imported and instantiated. But I got some errors asI have traced the error for using default argument. I found the
window_fn
is a stringtorch._VariableFunctionsClass.hann_window
. It seems the import path is treated as a string. But even though this path is imported, it will raise an error since the window function should be imported asfrom torch import hann_window
orimport torch.hann_window
, rather thanimport torch._VariableFunctionsClass.hann_window
.Environment