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

news/2024/6/19 3:16:20 标签: macos, 开源, tensorflow, spleeter

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

spleeter_2">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
复制进行搜索,右键下载:

在这里插入图片描述
找到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包装器)安装也有点慢:

在这里插入图片描述

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

在这里插入图片描述
我试第二次速度很快下好了,其他资源也顺利ok

在这里插入图片描述

spleeter_215">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

成功!

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

在这里插入图片描述

在这里插入图片描述

vocals 即为人声文件


http://www.niftyadmin.cn/n/405639.html

相关文章

旗开得胜,高考:人生的一次逆袭之旅

亲爱的读者们&#xff0c;大家好&#xff01; 明天就是一年一度的高考&#xff0c;这个注定会改变莘莘学子一生的重要时刻即将到来。在这个充满期待和紧张的日子里&#xff0c;我想与你们分享一个关于我自己高考的故事&#xff0c;希望能给你们带来鼓励和启示。 那是一个阳光…

Mysql数据库入门基础篇--mysql基本了解

【Mysql数据库入门基础篇--mysql基本了解 &#x1f53b;一、Mysql5.7 VS Mysql8.0 详解1.1 ⛳字符编码1.2 ⛳用户的创建与授权1.3 ⛳ 认证插件1.4 ⛳ 隐藏索引1.5 ⛳ 持久化设置1.6 ⛳ 通用表达式&#xff08;Common Table Expressions&#xff09;1.7 ⛳ 性能提升1.8 ⛳ 参数变…

简述数据库中 InnoDB 和 MyISAM 引擎

目录 1、修改默认的存储引擎 2、关于 InnoDB 引擎 InnoDB 的优势 具备外键支持功能的事务存储引擎 InnoDB 索引的 B 树结构&#xff1a; 3、关于 MyISAM 引擎 MyISQM 的优势 MyISAM 索引的数据结构 4、 InnoDB 与 MyISAM 引擎对比图 1、修改默认的存储引擎 前提说明&…

【AUTOSAR】Bootloader说明(三)---- copy数据及中断处理

拷贝代码及数据到RAM CopyCodeToRam () 28xx的FLASH按扇区操作&#xff0c;但除正在操作的扇区外&#xff0c;其他扇区同样不可读。因而在开始程序刷新后&#xff0c;所有代码都必须在RAM里运行。而代码是存储在FLASH中&#xff0c;在开始程序刷新之前&#xff0c;应该把刷新相…

大数据存储执行语句

插入数据 insert into classname values(2,“大数据二班”); 建表语句 create table order_his( create_date string, order_id string, order_status string, dw_begin_date string, dw_end_date string )ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘,’; 加载数据到Hiv…

chatgpt赋能python:Python如何输出在同一行

Python如何输出在同一行 在Python编程中&#xff0c;有时候我们需要将多个输出放在同一行中。这篇文章将介绍几种方法来实现这个任务&#xff0c;并给出一些例子来帮助你更好地理解。 方法一&#xff1a;使用print函数 Python中的print函数默认会在每个输出之间换行。但是&a…

基于SpringBoot+Vue的学生综合测评系统设计与实现

博主介绍&#xff1a; 大家好&#xff0c;我是一名在Java圈混迹十余年的程序员&#xff0c;精通Java编程语言&#xff0c;同时也熟练掌握微信小程序、Python和Android等技术&#xff0c;能够为大家提供全方位的技术支持和交流。 我擅长在JavaWeb、SSH、SSM、SpringBoot等框架下…

Freeswitch学习笔记(三):配置

参考Configuration文档: https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Configuration/ 1.默认配置 修改xml后reloadxml生效 快捷键F? <cli-keybindings><key name="1" value="help"/><key name="2"…