eightban's memo

残しておきたい記事をまとめてみました。このブログに書いてあるドキュメントやブログで配布しているファイルの使用によって発生するいかなる損害に対してもこのブログの管理者は責任を負いません。使用する場合は自己責任のもとに使用してください。

Python

Retrieval-based-Voice-Conversion-WebUIをwinpythonにインストールする

更新日:

インストール

"D:\WinPython\#winpythonPrompt.bat"実行します

PyTorchを仮想環境ではなくベースにインストールする場合はこの場所でインストールします

https://pytorch.org/get-started/locally/

環境にあったものをWebサイトから確認して実行します

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

ffmpegのダウンロードと展開ffmpeg-master-latest-win64-gpl.zip

Releases · BtbN/FFmpeg-Builds (github.com)

"D:\WinPython\ffmpeg"に展開します

環境をクローンし仮想環境を作った後必要なライブラリーをインストール

git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI
cd Retrieval-based-Voice-Conversion-WebUI
python.exe -m venv venv  --system-site-packages
venv\Scripts\activate
pip install -r requirements.txt 

CLI もインストール

ライブラリーにインストールされます

git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion
pip install Retrieval-based-Voice-Conversion-develop/

モデルのダウンロード

一式入ってるセットを使うと楽なのでそれを使います。

Releases · RVC-Project/Retrieval-based-Voice-Conversion-WebUI (github.com)

RVC1006Nvidia.7zのassetsフォルダを丸ごとコピーします

実行

cd Retrieval-based-Voice-Conversion-WebUI
venv\Scripts\activate
python.exe infer-web.py --pycmd python.exe --port 7897

CLI Usage

rvc infer -m {model.pth} -i {input.wav} -o {output.wav}
rvc infer -m kikiV1.pth -i prec.wav -o output.wav

次のエラーが出て実行できません


  File "D:\WinPython\content\Retrieval-based-Voice-Conversion-WebUI\venv\lib\site-packages\rvc\wrapper\cli\handler\infer.py", line 129, in infer
    wavfile.write(outputpath, tgt_sr, audio_opt)
  File "D:\WinPython\python-3.10.11.amd64\lib\site-packages\scipy\io\wavfile.py", line 772, in write
    dkind = data.dtype.kind
AttributeError: 'NoneType' object has no attribute 'dtype'

仮想環境へのインストールと実行用のバッチファイル

@echo off
call %~dp0\scripts\env_for_icons.bat  %*
SET PATH=%PATH%;%WINPYDIRBASE%\PortableGit;%WINPYDIRBASE%\PortableGit\bin
SET PATH=%PATH%;%WINPYDIRBASE%\ffmpeg\bin
If not exist %WINPYDIRBASE%\content mkdir  %WINPYDIRBASE%\content 

set APP_NAME=Retrieval-based-Voice-Conversion-WebUI
set APP_DIR=%WINPYDIRBASE%\content\%APP_NAME%
echo %APP_DIR%
cd %WINPYDIRBASE%\content\

If not exist  %APP_DIR% git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI

cd %APP_DIR%
timeout /t 5
if not defined VENV_DIR (set "VENV_DIR=%APP_DIR%\venv")
if EXIST %VENV_DIR% goto :activate_venv

::python.exe -m venv "%VENV_DIR%" 
python.exe -m venv "%VENV_DIR%" --system-site-packages 
if %ERRORLEVEL% == 0 goto :pip
echo Unable to create venv 
goto :skip_venv

:pip
call "%VENV_DIR%\Scripts\activate"
pip install -r requirements.txt
git clone https://github.com/RVC-Project/Retrieval-based-Voice-Conversion
pip install Retrieval-based-Voice-Conversion/
cmd.exe /k

:activate_venv
call "%VENV_DIR%\Scripts\activate"
powershell -ExecutionPolicy  -command "$Obj = Start-Process  -FilePath timeout -argumentlist '/t 23' -PassThru ; Wait-Process -InputObject  $Obj  -Timeout 22 " > nul 2>&1
if %errorlevel% equ 0  "D:\WinPython\Spyder.exe" & cmd.exe /k 

If not exist %WINPYDIRBASE%\content\%APP_NAME%\assets\rmvpe\rmvpe.pt goto :skip_cmd
echo on
python.exe infer-web.py --pycmd python.exe --port 7897
goto :skip_venv
:skip_cmd
::
:skip_venv
cmd.exe /k

-Python

Copyright© eightban's memo , 2024 All Rights Reserved Powered by STINGER.