vbelz / Speech-enhancement

Deep learning for audio denoising
MIT License
646 stars 124 forks source link

Parser takes only first character from the filename and says “File not found” #12

Closed jacktheripper-17 closed 3 years ago

jacktheripper-17 commented 3 years ago

I know it's very difficult to understand my issue, but I'll try my best to explain. So I've cloned a repository from Github and working on it. When I run the program without any arguments, it works fine python main.py --audio_input_prediction works fine. But when I try to pass my own file, it shows an error. python main.py --audio_input_prediction myaudio.wav shows an error saying "FileNotFoundError: [Errno 2] No such file or directory: '<File Path/m'" Notice how it only takes the first character from my argument? In the code, for default mode, it's something like: (args.py)parser.add_argument('--audio_input_prediction', default=['default_audio.wav'], type=list) and it works fine. So naturally, I tried to add '[]' to my file name python main.py --audio_input_prediction [myaudio.wav] Shows an error too which says "FileNotFoundError: [Errno 2] No such file or directory: '<File Path/['" See, here it took only the first character of my provided argument i.e. '[' And the file IS there. No spelling mistakes in file name either. Any help would be very much appreciated.

In my conclusion, the issue is in args.py, specifically in this line `parser.add_argument('--audio_input_prediction', default=['noisy_voice_long_t2.wav'], type=list)'. I even tried to change the type to 'str', but still, I got the same error

cristigeoo13 commented 3 years ago

Hello @jacktheripper-17 , did you figure out a way to solve this problem eventually ?

jacktheripper-17 commented 3 years ago

Hello @jacktheripper-17 , did you figure out a way to solve this problem eventually ?

Yes, I did. Do you want a solution as well?

cristigeoo13 commented 3 years ago

Yes, if it is not a problem 😄

jacktheripper-17 commented 3 years ago

Check out this thread. I asked people on StackOverflow lol https://stackoverflow.com/questions/66282869/parser-takes-only-first-character-from-the-filename-and-says-file-not-found