Spleeter: [Bug] std::bad_alloc and core dumped

Created on 13 Nov 2019  路  7Comments  路  Source: deezer/spleeter

Description

Run results in std::bad_alloc and core dump.

(spleeter-cpu) abe@mill:~/git/github/deezer$ spleeter separate -i ~/play/music/bin/BOY\ HARSHER\ -\ Fate-1162083825.mp3 -p spleeter:2stems -o boyharsher
OMP: Info #212: KMP_AFFINITY: decoding x2APIC ids.
OMP: Info #210: KMP_AFFINITY: Affinity capable, using global cpuid leaf 11 info
OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: 0-3
OMP: Info #156: KMP_AFFINITY: 4 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #179: KMP_AFFINITY: 1 packages x 4 cores/pkg x 1 threads/core (4 total cores)
OMP: Info #214: KMP_AFFINITY: OS proc to physical thread map:
OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0 core 0 
OMP: Info #171: KMP_AFFINITY: OS proc 1 maps to package 0 core 1 
OMP: Info #171: KMP_AFFINITY: OS proc 2 maps to package 0 core 2 
OMP: Info #171: KMP_AFFINITY: OS proc 3 maps to package 0 core 3 
OMP: Info #250: KMP_AFFINITY: pid 17599 tid 17599 thread 0 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 17599 tid 17842 thread 1 bound to OS proc set 1
INFO:spleeter:Loading audio b'/home/abe/play/music/bin/BOY HARSHER - Fate-1162083825.mp3' from 0.0 to 600.0
INFO:spleeter:Audio data loaded successfully
OMP: Info #250: KMP_AFFINITY: pid 17599 tid 17841 thread 2 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 17599 tid 17873 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 17599 tid 17874 thread 4 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 17599 tid 17875 thread 5 bound to OS proc set 1
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

The song is Boy Harsher's "Fate".

Step to reproduce

youtube-dl 'https://boyharsher.bandcamp.com/track/fate'
conda activate spleeter-cpu
spleeter separate -i ./BOY\ HARSHER\ -\ Fate-1162083825.mp3 -p spleeter:2stems -o boyharsher

Output

(base) abe@mill:~/git/github/deezer$ conda activate spleeter-cpu
(spleeter-cpu) abe@mill:~/git/github/deezer$ spleeter separate -i ./BOY\ HARSHER\ -\ Fate-1162083825.mp3 -p spleeter:2stems -o boy^C
(spleeter-cpu) abe@mill:~/git/github/deezer$ spleeter separate -i ./BOY\ HARSHER\ -\ Fate-1162083825.mp3 -p spleeter:2stems -o boy
OMP: Info #212: KMP_AFFINITY: decoding x2APIC ids.
OMP: Info #210: KMP_AFFINITY: Affinity capable, using global cpuid leaf 11 info
OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: 0-3
OMP: Info #156: KMP_AFFINITY: 4 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #179: KMP_AFFINITY: 1 packages x 4 cores/pkg x 1 threads/core (4 total cores)
OMP: Info #214: KMP_AFFINITY: OS proc to physical thread map:
OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0 core 0 
OMP: Info #171: KMP_AFFINITY: OS proc 1 maps to package 0 core 1 
OMP: Info #171: KMP_AFFINITY: OS proc 2 maps to package 0 core 2 
OMP: Info #171: KMP_AFFINITY: OS proc 3 maps to package 0 core 3 
OMP: Info #250: KMP_AFFINITY: pid 18464 tid 18464 thread 0 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 18464 tid 18519 thread 1 bound to OS proc set 1
INFO:spleeter:Loading audio b'./BOY HARSHER - Fate-1162083825.mp3' from 0.0 to 600.0
INFO:spleeter:Audio data loaded successfully
OMP: Info #250: KMP_AFFINITY: pid 18464 tid 18518 thread 2 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 18464 tid 18555 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 18464 tid 18556 thread 4 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 18464 tid 18557 thread 5 bound to OS proc set 1
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

Environment

| | |
| ----------------- | ------------------------------- |
| OS | Linux "Ubuntu 16.04.6 LTS" |
| Installation type | Conda 4.7.12 |
| RAM available | Mem: 8043652 2265104 4506872 394280 1271676 5052192, Swap: 8257532 2849108 5408424 |
| Hardware spec | no GPU, 4 CPUs (Intel(R) Core(TM) i5-3330 CPU @ 3.00GHz) |

Additional context

I followed the quick start guide from the repo.

The test mp3 that came with the repo successfully ran.

bug invalid

Most helpful comment

I am seeing this too with the docker image. I can split the test audio file but all other files regardless how they are encoded fail with

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

All 7 comments

I am seeing this too with the docker image. I can split the test audio file but all other files regardless how they are encoded fail with

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

Hi,

It's a very low-level bug and it's hard for us to hep you on that. Can you give us the core dumps ?

I am also receiving this problem while trying to run the 4stems program on an mp3 file that successfully ran the 2stem program. This machine is intel i3, 4GB RAM, Ubuntu 18.04
Please can you clarify what the minimum specs should be to convert 1 mp3 ile into 4 or 5 stems?

Here is another attempt with a wav file trying to separate into 2 stems

(spleeter-cpu) terry@Terry-Ubuntu:~/spleeter$ spleeter separate -i MySong_42MB.wav -p spleeter:2stems -o output
OMP: Info #212: KMP_AFFINITY: decoding x2APIC ids.
OMP: Info #210: KMP_AFFINITY: Affinity capable, using global cpuid leaf 11 info
OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: 0-3
OMP: Info #156: KMP_AFFINITY: 4 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #179: KMP_AFFINITY: 1 packages x 2 cores/pkg x 2 threads/core (2 total cores)
OMP: Info #214: KMP_AFFINITY: OS proc to physical thread map:
OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0 core 0 thread 0 
OMP: Info #171: KMP_AFFINITY: OS proc 1 maps to package 0 core 0 thread 1 
OMP: Info #171: KMP_AFFINITY: OS proc 2 maps to package 0 core 2 thread 0 
OMP: Info #171: KMP_AFFINITY: OS proc 3 maps to package 0 core 2 thread 1 
OMP: Info #250: KMP_AFFINITY: pid 4292 tid 4292 thread 0 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 4292 tid 4346 thread 1 bound to OS proc set 2
INFO:spleeter:Loading audio b'MySong_42MB.wav' from 0.0 to 600.0
INFO:spleeter:Audio data loaded successfully
OMP: Info #250: KMP_AFFINITY: pid 4292 tid 4345 thread 2 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 4292 tid 4369 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 4292 tid 4370 thread 4 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 4292 tid 4371 thread 5 bound to OS proc set 2
terminate called after throwing an instance of 'std::bad_alloc'
terminate called recursively
Aborted (core dumped)

I've noticed that this error tends to occur when the program runs out of memory while processing the audio. For anyone using Docker, can you try increasing the amount of memory available to the container by a few gigabytes and seeing if the error goes away?

Memory requirements appear to increase with the duration of the input file, so a 5 minute audio file will take quite a bit more memory to process than a 1 minute audio file.

@mickdekkers I reduced the track length to 60 seconds and it worked, so looks like you are right. Will need to test it some more. Thanks for the tip.

Closing this. We'll add a disclaimer about memory specs in the documentation.

Was this page helpful?
0 / 5 - 0 ratings