deezer / spleeter

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

win10: TypeError: Expected int64, got 20.0 #622

Closed Mar-Pfa closed 3 years ago

Mar-Pfa commented 3 years ago

Description

i try to run a simple training test on win10 / conda / input is only single set of files

spleeter train -p .\base_config.json -d .

{ "train_csv": "train.csv", "validation_csv": "test.csv", "model_dir": "model", "mix_name": "mix", "instrument_list": ["vocals", "accompaniment"], "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": 1000000, "throttle_secs":300, "random_seed":0, "save_checkpoints_steps":150, "save_summary_steps":5, "model":{ "type":"unet.unet", "params":{} } }

train.csv: mix_path,vocals_path,accompaniment_path,duration output0.wav,output1.wav,output2.wav,200

validation.csv mix_path,vocals_path,accompaniment_path,duration output0.wav,output1.wav,output2.wav,200

Step to reproduce

  1. Installed regarding "quick start" section here conda install -c conda-forge ffmpeg libsndfile pip install spleeter

Output

spleeter train -p .\base_config.json -d . INFO:spleeter:Start model training Traceback (most recent call last): File "c:\programdata\anaconda3\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\programdata\anaconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\Scripts\spleeter.exe__main.py", line 7, in File "c:\programdata\anaconda3\lib\site-packages\spleeter__main.py", line 256, in entrypoint spleeter() File "c:\programdata\anaconda3\lib\site-packages\typer\main.py", line 214, in call__ return get_command(self)(*args, **kwargs) File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 829, in call return self.main(args, kwargs) File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 782, in main rv = self.invoke(ctx) File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 610, in invoke return callback(args, kwargs) File "c:\programdata\anaconda3\lib\site-packages\typer\main.py", line 497, in wrapper return callback(use_params) # type: ignore File "c:\programdata\anaconda3\lib\site-packages\spleeter__main__.py", line 89, in train tf.estimator.train_and_evaluate(estimator, train_spec, evaluation_spec) File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\training.py", line 505, in train_and_evaluate return executor.run() File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\training.py", line 646, in run return self.run_local() File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\training.py", line 743, in run_local self._estimator.train( File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 349, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1175, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1201, in _train_model_default self._get_features_and_labels_from_input_fn(input_fn, ModeKeys.TRAIN)) File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1037, in _get_features_and_labels_from_input_fn self._call_input_fn(input_fn, mode)) File "c:\programdata\anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 1130, in _call_input_fn return input_fn(**kwargs) File "c:\programdata\anaconda3\lib\site-packages\spleeter\dataset.py", line 85, in get_training_dataset return builder.build( File "c:\programdata\anaconda3\lib\site-packages\spleeter\dataset.py", line 550, in build dataset = self.compute_segments(dataset, n_chunks_per_song) File "c:\programdata\anaconda3\lib\site-packages\spleeter\dataset.py", line 453, in compute_segments dataset.map( File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 1695, in map return MapDataset(self, map_func, preserve_cardinality=True) File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 4041, in init__ self._map_func = StructuredFunctionWrapper( File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 3371, in init self._function = wrapper_fn.get_concrete_function() File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 2938, in get_concrete_function graph_function = self._get_concrete_function_garbage_collected( File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 2906, in _get_concrete_function_garbage_collected graph_function, args, kwargs = self._maybe_define_function(args, kwargs) File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function graph_function = self._create_graph_function(args, kwargs) File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 3065, in _create_graph_function func_graph_module.func_graph_from_py_func( File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func func_outputs = python_func(*func_args, *func_kwargs) File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 3364, in wrapper_fn ret = _wrapper_helper(args) File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 3299, in _wrapper_helper ret = autograph.tf_convert(func, ag_ctx)(*nested_args) File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\autograph\impl\api.py", line 258, in wrapper raise e.ag_error_metadata.to_exception(e) TypeError: in user code:

c:\programdata\anaconda3\lib\site-packages\spleeter\dataset.py:454 None  *
    lambda sample: dict(
c:\programdata\anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py:1141 binary_op_wrapper
    raise e
c:\programdata\anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py:1125 binary_op_wrapper
    return func(x, y, name=name)
c:\programdata\anaconda3\lib\site-packages\tensorflow\python\util\dispatch.py:201 wrapper
    return target(*args, **kwargs)
c:\programdata\anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py:527 subtract
    return gen_math_ops.sub(x, y, name)
c:\programdata\anaconda3\lib\site-packages\tensorflow\python\ops\gen_math_ops.py:10465 sub
    _, _, _op, _outputs = _op_def_library._apply_op_helper(
c:\programdata\anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py:475 _apply_op_helper
    raise TypeError(

TypeError: Expected int64 passed to parameter 'y' of op 'Sub', got 20.0 of type 'float' instead. Error: Expected int64, got 20.0 of type 'float' instead.

Environment

OS = Windows Installation type Conda / pip RAM available 32GB
Hardware spec Nvidia GPU

Mar-Pfa commented 3 years ago

Any Idea!? Maybe the Input-Data not correct!? I used wav 16 Bit PCM 44.100 stereo Help would be cool, thanks!

Mar-Pfa commented 3 years ago

Argh... found the Reason: Validation of the Input data could be improved: the duration of the training files were entered without decimal separator -> 200 - i changed it to 200.0 and now it works

beside that it looks like that the 2stems/base_config.json is missing some entries that causes the code also to fail - i've added now all the entries from the 4stems and it runs through e.g. the entry "n_chunks_per_song":40,

Mar-Pfa commented 3 years ago

so for me it's closed (just to mention -> validation of parameters would be a good improval... but i've no idea about python so i cannot create a pullrequest for this, sry)