mac使用anaconda安装人声分离开源工具spleeter

0. 以下为一步步自己摸索的成功安装过程

1. 安装 spleeter

注:anaconda 的虚拟环境

conda install spleeter

太慢

pip install spleeter

下载卡住

(tensorflow) Robin-macbook-pro:~ robin$ pip install spleeter
Collecting spleeter
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(54, 'Connection reset by peer'))': /packages/de/f6/5e0cab1051d97f56d32c69b3e9bb9e9d90ec68598ee83c7dee7b44106bd0/spleeter-2.3.1-py3-none-any.whl
  Downloading spleeter-2.3.1-py3-none-any.whl (51 kB)
     |████████████████████████████████| 51 kB 22 kB/s            
Collecting tensorflow==2.5.0
  Downloading tensorflow-2.5.0-cp36-cp36m-macosx_10_11_x86_64.whl (195.6 MB)
     || 1.9 MB 4.2 kB/s eta 12:41:28ERROR: Exception:
Traceback (most recent call last):

所以自己去下载whl文件tensorflow-2.5.0-cp36-cp36m-macosx_10_11_x86_64.whl再安装

点击下载 tensorflow 2.5.0
复制进行搜索,右键下载:

mac使用anaconda安装人声分离开源工具spleeter_第1张图片
找到whl文件存放位置(我用的是anaconda虚拟环境,放在site-packages文件夹下面),
使用pip命令下载

pip install /Users/robin/software/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow-2.5.0-cp36-cp36m-macosx_10_11_x86_64.whl

尝试第二次后成功:

(tensorflow) Robin-macbook-pro:~ robin$ pip install /Users/robin/software/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow-2.5.0-cp36-cp36m-macosx_10_11_x86_64.whl
Processing ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow-2.5.0-cp36-cp36m-macosx_10_11_x86_64.whl
Collecting h5py~=3.1.0
  Downloading h5py-3.1.0-cp36-cp36m-macosx_10_9_x86_64.whl (2.9 MB)
     |████████████████████████████████| 2.9 MB 961 kB/s            
Requirement already satisfied: wheel~=0.35 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from tensorflow==2.5.0) (0.37.0)
Collecting opt-einsum~=3.3.0
  Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB 1.5 MB/s            
Collecting six~=1.15.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting gast==0.4.0
  Downloading gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting tensorflow-estimator<2.6.0,>=2.5.0rc0
  Downloading tensorflow_estimator-2.5.0-py2.py3-none-any.whl (462 kB)
     |████████████████████████████████| 462 kB 1.5 MB/s            
Collecting wrapt~=1.12.1
  Downloading wrapt-1.12.1.tar.gz (27 kB)
  Preparing metadata (setup.py) ... done
Collecting typing-extensions~=3.7.4
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting flatbuffers~=1.12.0
  Downloading flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Collecting protobuf>=3.9.2
  Downloading protobuf-3.19.6-cp36-cp36m-macosx_10_9_x86_64.whl (979 kB)
     |████████████████████████████████| 979 kB 1.8 MB/s            
Collecting keras-nightly~=2.5.0.dev
  Downloading keras_nightly-2.5.0.dev2021032900-py2.py3-none-any.whl (1.2 MB)
     |████████████████████████████████| 1.2 MB 2.1 MB/s            
Collecting grpcio~=1.34.0
  Downloading grpcio-1.34.1-cp36-cp36m-macosx_10_10_x86_64.whl (3.7 MB)
     |████████████████████████████████| 3.7 MB 3.4 MB/s            
Collecting numpy~=1.19.2
  Downloading numpy-1.19.5-cp36-cp36m-macosx_10_9_x86_64.whl (15.6 MB)
     |████████████████████████████████| 15.6 MB 6.1 MB/s            
Collecting tensorboard~=2.5
  Downloading tensorboard-2.10.1-py3-none-any.whl (5.9 MB)
     |████████████████████████████████| 5.9 MB 6.1 MB/s            
Collecting keras-preprocessing~=1.1.2
  Downloading Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 2.0 MB/s            
Collecting absl-py~=0.10
  Downloading absl_py-0.15.0-py3-none-any.whl (132 kB)
     |████████████████████████████████| 132 kB 5.8 MB/s            
Collecting google-pasta~=0.2
  Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting astunparse~=1.6.3
  Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: termcolor~=1.1.0 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from tensorflow==2.5.0) (1.1.0)
Collecting cached-property
  Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting tensorboard-data-server<0.7.0,>=0.6.0
  Downloading tensorboard_data_server-0.6.1-py3-none-macosx_10_9_x86_64.whl (3.5 MB)
     |████████████████████████████████| 3.5 MB 5.4 MB/s            
Requirement already satisfied: setuptools>=41.0.0 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from tensorboard~=2.5->tensorflow==2.5.0) (58.4.0)
Requirement already satisfied: werkzeug>=1.0.1 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from tensorboard~=2.5->tensorflow==2.5.0) (2.0.1)
Collecting tensorboard-plugin-wit>=1.6.0
  Downloading tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB)
     |████████████████████████████████| 781 kB 6.1 MB/s            
Requirement already satisfied: requests<3,>=2.21.0 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from tensorboard~=2.5->tensorflow==2.5.0) (2.22.0)
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Downloading google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: markdown>=2.6.8 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from tensorboard~=2.5->tensorflow==2.5.0) (3.1.1)
Collecting google-auth<3,>=1.6.3
  Downloading google_auth-2.19.1-py2.py3-none-any.whl (181 kB)
     |████████████████████████████████| 181 kB 7.8 MB/s            
Collecting cachetools<6.0,>=2.0.0
  Downloading cachetools-4.2.4-py3-none-any.whl (10 kB)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from google-auth<3,>=1.6.3->tensorboard~=2.5->tensorflow==2.5.0) (0.2.6)
Collecting rsa<5,>=3.1.4
  Downloading rsa-4.9-py3-none-any.whl (34 kB)
Requirement already satisfied: urllib3<2.0 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from google-auth<3,>=1.6.3->tensorboard~=2.5->tensorflow==2.5.0) (1.24.2)
Collecting requests-oauthlib>=0.7.0
  Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: certifi>=2017.4.17 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow==2.5.0) (2019.6.16)
Requirement already satisfied: idna<2.9,>=2.5 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow==2.5.0) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow==2.5.0) (3.0.4)
Requirement already satisfied: dataclasses in ./software/anaconda3/envs/tensorflow/lib/python3.6/site-packages (from werkzeug>=1.0.1->tensorboard~=2.5->tensorflow==2.5.0) (0.8)
Collecting pyasn1<0.5.0,>=0.4.6
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 4.0 MB/s            
Collecting oauthlib>=3.0.0
  Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB)
     |████████████████████████████████| 151 kB 6.4 MB/s            
Building wheels for collected packages: wrapt
  Building wheel for wrapt (setup.py) ... done
  Created wheel for wrapt: filename=wrapt-1.12.1-cp36-cp36m-macosx_10_7_x86_64.whl size=33302 sha256=8300ef628e612d7652de2106b9f1ebf47091cb7f96c313feebfc8c49877e4ba0
  Stored in directory: /Users/robin/Library/Caches/pip/wheels/32/42/7f/23cae9ff6ef66798d00dc5d659088e57dbba01566f6c60db63
Successfully built wrapt
Installing collected packages: pyasn1, six, rsa, oauthlib, cachetools, requests-oauthlib, google-auth, tensorboard-plugin-wit, tensorboard-data-server, protobuf, numpy, grpcio, google-auth-oauthlib, cached-property, absl-py, wrapt, typing-extensions, tensorflow-estimator, tensorboard, opt-einsum, keras-preprocessing, keras-nightly, h5py, google-pasta, gast, flatbuffers, astunparse, tensorflow
  Attempting uninstall: pyasn1
    Found existing installation: pyasn1 0.4.5
    Uninstalling pyasn1-0.4.5:
      Successfully uninstalled pyasn1-0.4.5
  Attempting uninstall: six
    Found existing installation: six 1.12.0
    Uninstalling six-1.12.0:
      Successfully uninstalled six-1.12.0
  Attempting uninstall: protobuf
    Found existing installation: protobuf 3.6.0
    Uninstalling protobuf-3.6.0:
      Successfully uninstalled protobuf-3.6.0
  Attempting uninstall: numpy
    Found existing installation: numpy 1.16.5
    Uninstalling numpy-1.16.5:
      Successfully uninstalled numpy-1.16.5
  Attempting uninstall: grpcio
    Found existing installation: grpcio 1.16.1
    Uninstalling grpcio-1.16.1:
      Successfully uninstalled grpcio-1.16.1
  Attempting uninstall: absl-py
    Found existing installation: absl-py 0.7.1
    Uninstalling absl-py-0.7.1:
      Successfully uninstalled absl-py-0.7.1
  Attempting uninstall: wrapt
    Found existing installation: wrapt 1.11.2
    Uninstalling wrapt-1.11.2:
      Successfully uninstalled wrapt-1.11.2
  Attempting uninstall: typing-extensions
    Found existing installation: typing-extensions 3.10.0.0
    Uninstalling typing-extensions-3.10.0.0:
      Successfully uninstalled typing-extensions-3.10.0.0
  Attempting uninstall: tensorflow-estimator
    Found existing installation: tensorflow-estimator 1.13.0
    Uninstalling tensorflow-estimator-1.13.0:
      Successfully uninstalled tensorflow-estimator-1.13.0
  Attempting uninstall: tensorboard
    Found existing installation: tensorboard 1.13.1
    Uninstalling tensorboard-1.13.1:
      Successfully uninstalled tensorboard-1.13.1
  Attempting uninstall: keras-preprocessing
    Found existing installation: Keras-Preprocessing 1.1.0
    Uninstalling Keras-Preprocessing-1.1.0:
      Successfully uninstalled Keras-Preprocessing-1.1.0
  Attempting uninstall: h5py
    Found existing installation: h5py 2.8.0
    Uninstalling h5py-2.8.0:
      Successfully uninstalled h5py-2.8.0
  Attempting uninstall: gast
    Found existing installation: gast 0.2.2
    Uninstalling gast-0.2.2:
      Successfully uninstalled gast-0.2.2
  Attempting uninstall: tensorflow
    Found existing installation: tensorflow 1.13.1
    Uninstalling tensorflow-1.13.1:
      Successfully uninstalled tensorflow-1.13.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
astroid 2.3.3 requires wrapt==1.11.*, but you have wrapt 1.12.1 which is incompatible.
Successfully installed absl-py-0.15.0 astunparse-1.6.3 cached-property-1.5.2 cachetools-4.2.4 flatbuffers-1.12 gast-0.4.0 google-auth-2.19.1 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 grpcio-1.34.1 h5py-3.1.0 keras-nightly-2.5.0.dev2021032900 keras-preprocessing-1.1.2 numpy-1.19.5 oauthlib-3.2.2 opt-einsum-3.3.0 protobuf-3.19.6 pyasn1-0.4.8 requests-oauthlib-1.3.1 rsa-4.9 six-1.15.0 tensorboard-2.10.1 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorflow-2.5.0 tensorflow-estimator-2.5.0 typing-extensions-3.7.4.3 wrapt-1.12.1

安装好tensorflow之后,继续回到上一步:

pip install spleeter

会自行安装其它适配安装包资源

这个lvmpy(llvm C ++库的Python包装器)安装也有点慢:

mac使用anaconda安装人声分离开源工具spleeter_第2张图片

注:实在不行的话,可以使用相同手法,在这里搜索并下载相应版本

mac使用anaconda安装人声分离开源工具spleeter_第3张图片
我试第二次速度很快下好了,其他资源也顺利ok

2. 测试 spleeter

使用的语法很简单,spleeter separate -i 目标文件 -p spleeter:2stems -o 输出文件夹 ,上代码:

(tensorflow) Robin-macbook-pro:~ robin$ spleeter separate -i /Users/robin/Desktop/123.m4a  -p spleeter:2stems -o /Users/robin/Desktop
INFO:spleeter:Downloading model archive https://github.com/deezer/spleeter/releases/download/v1.4.0/2stems.tar.gz
INFO:spleeter:Validating archive checksum
INFO:spleeter:Extracting downloaded 2stems archive
INFO:spleeter:2stems model file(s) extracted
INFO:spleeter:File /Users/robin/Desktop/123/vocals.wav written succesfully
INFO:spleeter:File /Users/robin/Desktop/123/accompaniment.wav written succesfully

成功!

注:文件生成位置自动取了原文件的名称作为文件存放上级文件夹

mac使用anaconda安装人声分离开源工具spleeter_第4张图片

mac使用anaconda安装人声分离开源工具spleeter_第5张图片

vocals 即为人声文件

你可能感兴趣的:(编程环境和工具,#,声纹,其他小经验,macos,开源,tensorflow,spleeter)