deezer / spleeter

Deezer source separation library including pretrained models.
https://research.deezer.com/projects/spleeter.html
MIT License
25.84k stars 2.83k forks source link

[Bug] FileNotFoundError: [WinError 3] #334

Closed wesleyr36 closed 4 years ago

wesleyr36 commented 4 years ago

Description

FileNotFoundError: [WinError 3] The system cannot find the path specified: '' when trying to train on custom dataset

Step to reproduce

  1. Installed using pip
  2. Run spleeter train -p configs\hi_config.json -d D:/hi
  3. Got FileNotFoundError: [WinError 3] or

    Output

INFO:spleeter:Start model training
Traceback (most recent call last):
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\wesle\AppData\Local\Programs\Python\Python36\Scripts\spleeter.exe\__main__.py", line 9, in <module>
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\spleeter\__main__.py", line 54, in entrypoint
    main(sys.argv)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\spleeter\__main__.py", line 46, in main
    entrypoint(arguments, params)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\spleeter\commands\train.py", line 98, in entrypoint
    evaluation_spec)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\training.py", line 473, in train_and_evaluate
    return executor.run()
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\training.py", line 613, in run
    return self.run_local()
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\training.py", line 714, in run_local
    saving_listeners=saving_listeners)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 370, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1161, in _train_model
    return self._train_model_default(input_fn, hooks, saving_listeners)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1188, in _train_model_default
    input_fn, ModeKeys.TRAIN))
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1025, in _get_features_and_labels_from_input_fn
    self._call_input_fn(input_fn, mode))
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1116, in _call_input_fn
    return input_fn(**kwargs)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\spleeter\dataset.py", line 78, in get_training_dataset
    wait_for_cache=False)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\spleeter\dataset.py", line 406, in build
    dataset = self.cache(dataset, cache_directory, wait_for_cache)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\site-packages\spleeter\dataset.py", line 367, in cache
    os.makedirs(cache_path, exist_ok=True)
  File "c:\users\wesle\appdata\local\programs\python\python36\lib\os.py", line 220, in makedirs
    mkdir(name, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

Environment

OS Windows 10 Pro
Installation type pip
RAM available 32GB
Hardware spec AMD Ryzen 5 3600X

hi_config

{ "train_csv": "configs/hi_train.csv", "validation_csv": "configs/hi_validation.csv", "model_dir": "hi", "mix_name": "mix", "instrument_list": ["vocals", "piano", "drums", "bass", "other", "guitar"], "sample_rate":44100, "frame_length":4096, "frame_step":1024, "T":512, "F":1024, "n_channels":2, "separation_exponent":2, "mask_extension":"zeros", "learning_rate": 1e-4, "batch_size":4, "training_cache":"training_cache", "validation_cache":"validation_cache", "train_max_steps": 2500000, "throttle_secs":600, "random_seed":8, "save_checkpoints_steps":300, "save_summary_steps":5, "model":{ "type":"unet.softmax_unet", "params":{ "conv_activation":"ELU", "deconv_activation":"ELU" } } }

train and validation .cvs

mix_path vocals_path drums_path bass_path piano_path guitar_path other_path duration
train/Queen - Bicycle Race/mixture.wav train/Queen - Bicycle Race/vocals.wav train/Queen - Bicycle Race/drums.wav train/Queen - Bicycle Race/bass.wav train/Queen - Bicycle Race/piano.wav train/Queen - Bicycle Race/guitar.wav train/Queen - Bicycle Race/guitar.wav 180.697
train/Queen - Death On Two Legs/mixture.wav train/Queen - Death On Two Legs/vocals.wav train/Queen - Death On Two Legs/drums.wav train/Queen - Death On Two Legs/bass.wav train/Queen - Death On Two Legs/piano.wav train/Queen - Death On Two Legs/guitar.wav train/Queen - Death On Two Legs/guitar.wav 223.033
train/Queen - Dont Stop Me Now/mixture.wav train/Queen - Dont Stop Me Now/vocals.wav train/Queen - Dont Stop Me Now/drums.wav train/Queen - Dont Stop Me Now/bass.wav train/Queen - Dont Stop Me Now/piano.wav train/Queen - Dont Stop Me Now/guitar.wav train/Queen - Dont Stop Me Now/other.wav 215.347
train/Queen - Get Down Make Love/mixture.wav train/Queen - Get Down Make Love/vocals.wav train/Queen - Get Down Make Love/drums.wav train/Queen - Get Down Make Love/bass.wav train/Queen - Get Down Make Love/piano.wav train/Queen - Get Down Make Love/guitar.wav train/Queen - Get Down Make Love/other.wav 259.382
train/Queen - Hammer To Fall/mixture.wav train/Queen - Hammer To Fall/vocals.wav train/Queen - Hammer To Fall/drums.wav train/Queen - Hammer To Fall/bass.wav train/Queen - Hammer To Fall/piano.wav train/Queen - Hammer To Fall/guitar.wav train/Queen - Hammer To Fall/other.wav 221.024
train/Queen - I Want To Break Free/mixture.wav train/Queen - I Want To Break Free/vocals.wav train/Queen - I Want To Break Free/drums.wav train/Queen - I Want To Break Free/bass.wav train/Queen - I Want To Break Free/piano.wav train/Queen - I Want To Break Free/guitar.wav train/Queen - I Want To Break Free/other.wav 256.171
train/Queen - Killer Queen/mixture.wav train/Queen - Killer Queen/vocals.wav train/Queen - Killer Queen/drums.wav train/Queen - Killer Queen/bass.wav train/Queen - Killer Queen/piano.wav train/Queen - Killer Queen/guitar.wav train/Queen - Killer Queen/other.wav 180.582
train/Queen - Keep Yourself Alive/mixture.wav train/Queen - Keep Yourself Alive/vocals.wav train/Queen - Keep Yourself Alive/drums.wav train/Queen - Keep Yourself Alive/bass.wav train/Queen - Keep Yourself Alive/piano.wav train/Queen - Keep Yourself Alive/guitar.wav train/Queen - Keep Yourself Alive/other.wav 229.102
train/Queen - Stone Cold Crazy/mixture.wav train/Queen - Stone Cold Crazy/vocals.wav train/Queen - Stone Cold Crazy/drums.wav train/Queen - Stone Cold Crazy/bass.wav train/Queen - Stone Cold Crazy/piano.wav train/Queen - Stone Cold Crazy/guitar.wav train/Queen - Stone Cold Crazy/other.wav 146.607
wesleyr36 commented 4 years ago

Hopefully i gave all that was needed

sahailee commented 4 years ago

This is happening to me as well. I installed the spleeter-gpu through conda and I have set the model_dir to point to the 2stems-finetune model.

sahailee commented 4 years ago

Hi @wesleyr36, I was able to fix the problem by editing the config file. Instead of having: "training_cache":"training_cache", "validation_cache":"validation_cache",

Try this: "training_cache":"cache/training", "validation_cache":"cache/validation",

If that doesn't work, then you can try to make sure your dependencies are the right version. I noticed that even though I installed the latest spleeter through Conda, it installed tensorflow 1.14.0. If your tensorflow or any other dependency doesn't match what is in the requirements.txt file, then install it by running a command like this:

pip install tensorflow==1.5.2

more generally: pip install [Package_Name]==<version#>


I'm now facing another problem though. I can now train a new model completely fine, but when I try to fine tune a model and have the model_dir point to the 2stems-finetune folder that is provided from the releases page, the training immediately exits. The output is: INFO:spleeter:Start model training INFO:splleter:Model training done

And the output is immediate, so I know no training has occurred. It's strange because I was able to fine-tune before, I did once about three weeks ago.

EDIT: Sorry about such a long post, but I fixed my issue. In my json file I had this line: "n_chunks_per_song":1, Once I removed it, and increased the train_max_size, it started working. Hope this can help anyone else

wesleyr36 commented 4 years ago

Thank you for the comment I will try it when I can

wesleyr36 commented 4 years ago

I have tried your solution and it seems to to be working Thank you for your help