deezer / deezer/spleeter

[Discussion] Please help troubleshooting error when trying to use a custom model trained on mono drum loops

Open
#762 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
28.4k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

I trained a model on 50K mono drum loops, to split them by kicks, mixed percusion, snares, brass (hats, crashes, etc).. Now when I try to test the model I get this error.

Cannot feed value of shape (1727, 2049, 2) for Tensor 'mixed_stft:0', which has shape '(None, 2049, 1)'

I've test this with a loop from my training set as well as one that much longer that wasn't used for training. Both give me the same error. This makes me wonder if the mono audio is being handled properly when trying to use the separate function.. I'd really appreciate the assistance in troubleshooting this, I've invested a lot of time and effort into building this model. - Thanks

> `spleeter separate -o sep_out -p drumsplit_config.json mixed.wav --verbose
> INFO:tensorflow:Apply unet for brass_perc_spectrogram
> WARNING:tensorflow:From /opt/conda/envs/spleeter/lib/python3.8/site-packages/tensorflow/python/keras/layers/normalization.py:534: _colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
> Instructions for updating:
> Colocations handled automatically by placer.
> INFO:tensorflow:Apply unet for kicks_spectrogram
> INFO:tensorflow:Apply unet for pitched_perc_spectrogram
> INFO:tensorflow:Apply unet for snares_claps_spectrogram
> INFO:tensorflow:Restoring parameters from pretrained_models/drumsplit_model/model.ckpt-200000
> Traceback (most recent call last):
> File "/opt/conda/envs/spleeter/bin/spleeter", line 8, in
> sys.exit(entrypoint())
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/spleeter/__main__.py", line 256, in entrypoint
> spleeter()
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
> return get_command(self)(*args, **kwargs)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/click/core.py", line 829, in __call__
> return self.main(*args, **kwargs)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/click/core.py", line 782, in main
> rv = self.invoke(ctx)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
> return _process_result(sub_ctx.command.invoke(sub_ctx))
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
> return ctx.invoke(self.callback, **ctx.params)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/click/core.py", line 610, in invoke
> return callback(*args, **kwargs)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/typer/main.py", line 497, in wrapper
> return callback(**use_params) # type: ignore
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/spleeter/__main__.py", line 128, in separate
> separator.separate_to_file(
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/spleeter/separator.py", line 378, in separate_to_file
> sources = self.separate(waveform, audio_descriptor)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/spleeter/separator.py", line 321, in separate
> return self._separate_librosa(waveform, audio_descriptor)
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/spleeter/separator.py", line 266, in _separate_librosa
> outputs = sess.run(
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 967, in run
> result = self._run(None, fetches, feed_dict, options_ptr,
> File "/opt/conda/envs/spleeter/lib/python3.8/site-packages/tensorflow/python/client/session.py", line 1164, in _run
> raise ValueError(
> ValueError: Cannot feed value of shape (1727, 2049, 2) for Tensor 'mixed_stft:0', which has shape '(None, 2049, 1)'`

Contributor guide

Open the contributing guide

Research direction

Start with the exact `spleeter separate` command and custom `drumsplit_config.json`, then inspect `spleeter/separator.py`, especially `separate`, `_separate_librosa`, and the failing `sess.run` call. Reproduce the reported shape error and document whether it comes from the custom model or input audio configuration, with a confirmed resolution or clearly scoped follow-up.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
audio-video-rtc, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.