DeepFilterNet icon indicating copy to clipboard operation
DeepFilterNet copied to clipboard

Unable to run deepFIlter form CLI

Open Anand195 opened this issue 3 years ago • 2 comments

Hi guys, I have followed the installation instruction using pip and now I'm stuck with SLURM and I don't know how to fix it

I'm executing deepfilternet from colab pro+ account.

Here is the issue.

Traceback (most recent call last): File "/usr/local/bin/deepFilter", line 5, in from df.enhance import run File "/usr/local/lib/python3.7/dist-packages/df/enhance.py", line 18, in from df.logger import init_logger, warn_once File "/usr/local/lib/python3.7/dist-packages/df/logger.py", line 49 if (jobid := os.getenv("SLURM_JOB_ID")) is not None: ^ SyntaxError: invalid syntax

This is which I get while trying to execute this :-> !deepFilter /content/test_audio_053830.wav --output-dir /content

Anyone got into this kind of issue??

DO let me know the solution / how can I run this.

Anand195 avatar Jul 25 '22 08:07 Anand195

Which python version are you using? I guess the if assign syntax may not be supported by your python version.

Rikorose avatar Jul 25 '22 08:07 Rikorose

I'm using python 3.9

Anand195 avatar Jul 26 '22 10:07 Anand195

i meet the same error, which python should use

MaxMax2016 avatar Aug 16 '22 05:08 MaxMax2016

This is an if assign expression (PEP 572) and supported by python 3.8 and higher. This should work with python 3.9 and is tested with CI with python 3.8 - 3.10.

@Anand195 when running this via codelab, I suggest to directly call the api within enhance.py directly from python.

Rikorose avatar Aug 16 '22 05:08 Rikorose

Thanks for the such an informative reply. It would be great it you share an example to tun this API directly from CLI.

Anand195 avatar Aug 17 '22 05:08 Anand195

If you want to run from CLI, you can either use deepFilter /content/test_audio_053830.wav --output-dir /content when installed via pip. Or you can clone the repository and call the enhance script: python DeepFilterNet/df/enhance.py /content/test_audio_053830.wav --output-dir /content

Rikorose avatar Aug 17 '22 06:08 Rikorose

If you want to run from CLI, you can either use deepFilter /content/test_audio_053830.wav --output-dir /content when installed via pip. Or you can clone the repository and call the enhance script: python DeepFilterNet/df/enhance.py /content/test_audio_053830.wav --output-dir /content

After satisfying all the requirements I'm getting the error

ModuleNotFoundError: No module named 'libdf'

Can't find pip package for this

Anand195 avatar Aug 17 '22 06:08 Anand195

Please try pip install deepfilterlib or follow the instructions on the readme.

Rikorose avatar Aug 18 '22 05:08 Rikorose

Please try pip install deepfilterlib or follow the instructions on the readme.

I have followed your instructions as well checked the ReadMe file , got into this error.

from io import load_audio, resample, save_audio

ImportError: cannot import name 'load_audio' from 'io'

also tried to solve this by myself, unfortunately can't find any library that can satisfy this error.

Anand195 avatar Aug 18 '22 10:08 Anand195

here is the io file: https://github.com/Rikorose/DeepFilterNet/blob/main/DeepFilterNet/df/io.py#L15

not sure what you are doing

Rikorose avatar Aug 18 '22 11:08 Rikorose

here is the io file: https://github.com/Rikorose/DeepFilterNet/blob/main/DeepFilterNet/df/io.py#L15

not sure what you are doing

Followed your reply and sendup with this situation Don't know how to get rid of this

(venv) 192:df caypro$ python3 enhance.py /Users/caypro/Downloads/drive-download-20220729T062801Z-001/3471_9849_20210807_060527.wav --output-dir /Users/caypro/Anand 2022-08-23 13:47:34 | INFO | DF | Running on torch 1.12.0 2022-08-23 13:47:34 | INFO | DF | Running on host 192.168.1.9 fatal: not a git repository (or any of the parent directories): .git Traceback (most recent call last): File "/Users/caypro/Anand/project/DeepFilterNet-main/DeepFilterNet/df/enhance.py", line 291, in run() File "/Users/caypro/Anand/project/DeepFilterNet-main/DeepFilterNet/df/enhance.py", line 287, in run main(parser.parse_args()) File "/Users/caypro/Anand/project/DeepFilterNet-main/DeepFilterNet/df/enhance.py", line 24, in main model, df_state, suffix = init_df( File "/Users/caypro/Anand/project/DeepFilterNet-main/DeepFilterNet/df/enhance.py", line 104, in init_df init_logger(file=log_file, level=log_level, model=model_base_dir) File "/Users/caypro/Anand/project/DeepFilterNet-main/DeepFilterNet/df/logger.py", line 46, in init_logger commit = get_commit_hash() File "/Users/caypro/Anand/project/DeepFilterNet-main/DeepFilterNet/df/utils.py", line 155, in get_commit_hash commit = subprocess.check_output(args).strip().decode() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1754, in _execute_child self.pid = _posixsubprocess.fork_exec( TypeError: expected str, bytes or os.PathLike object, not NoneType

kindly go through and do let me know the possible solutions.

Anand195 avatar Aug 23 '22 08:08 Anand195

Thanks for this backtrace. This is a bug and a fix will be included in the next release.

Rikorose avatar Aug 23 '22 08:08 Rikorose

Thanks, Will wait for the upcoming release with fix.

Anand195 avatar Aug 23 '22 08:08 Anand195