具体内容可以参看原作者的github地址:
spleeter项目github链接
conda create -n spleeter python=3.7
conda activate spleeter
conda install -c conda-forge spleeter
这里要安装的文件还是比较多的:
在这里我还是要说一下的,此处我们在下载个别库的时候或许有时候网络会慢,但是没关系的,一次下载不成功,之后再去尝试就好了嘛~
由于原项目的文件我没有下载成功,此处我是在一个备份网址上下载的:
https://gitee.com/mirrors/spleeter/raw/master/audio_example.mp3
spleeter separate -i audio_example.mp3 -p spleeter:2stems -o output
出现这个问题是因为版本升级的问题,之前的一些库不在原来的目录下了,例如我们这里出现的 jit ,解决办法,就是将该库从最新的目录下引入即可:
D:\softwares\Anaconda\install\envs\spleeter\Lib\site-packages\librosa\util\decorators.py
然后将
from numba.decorators
改为
from numba.core.decorators import jit as optional_jit
保存退出,再次运行即可
可以使用其他下载工具下载该模型文件,这里程序一直在搜索该模型文件而没有继续向下进行
https://github.com/deezer/spleeter/releases/download/v1.4.0/2stems.tar.gz
然后将文件放置到pretrained_models文件夹下的2stems文件夹下:
之后再次运行该程序:
spleeter separate -i audio_example.mp3 -p spleeter:2stems -o output
其他分类模型下载:其他分类模型文件下载链接(包括两种的、四种的、五种的)
但是这一步报错了ValueError:Can’t load save_path when it is None.
这下就没有错误了,执行成功后会出现如下结果:
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-7
OMP: Info #156: KMP_AFFINITY: 8 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #179: KMP_AFFINITY: 1 packages x 8 cores/pkg x 1 threads/core (8 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 #171: KMP_AFFINITY: OS proc 4 maps to package 0 core 4
OMP: Info #171: KMP_AFFINITY: OS proc 5 maps to package 0 core 5
OMP: Info #171: KMP_AFFINITY: OS proc 6 maps to package 0 core 6
OMP: Info #171: KMP_AFFINITY: OS proc 7 maps to package 0 core 7
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 19160 thread 0 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 19160 thread 1 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 22880 thread 2 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 18956 thread 8 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 23428 thread 12 bound to OS proc set 4
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 6992 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 16912 thread 7 bound to OS proc set 7
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 4264 thread 6 bound to OS proc set 6
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 22176 thread 4 bound to OS proc set 4
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 5200 thread 9 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 21368 thread 10 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 15160 thread 11 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 22224 thread 14 bound to OS proc set 6
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 19652 thread 5 bound to OS proc set 5
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 15096 thread 15 bound to OS proc set 7
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 24260 thread 13 bound to OS proc set 5
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 19524 thread 16 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 17908 thread 17 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 19516 thread 18 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 24540 thread 19 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 9528 thread 20 bound to OS proc set 4
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 6120 thread 21 bound to OS proc set 5
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 24108 thread 22 bound to OS proc set 6
OMP: Info #250: KMP_AFFINITY: pid 7496 tid 10668 thread 23 bound to OS proc set 7
INFO:spleeter:File output\audio_example/vocals.wav written succesfully
INFO:spleeter:File output\audio_example/accompaniment.wav written succesfully
好了,到了这里我们就可以到对应文件夹(output)下取寻找解析的文件了,以我的为例:
1.spleeter使用
2.spleeter环境搭建遇到的问题解决办法参考: