AI开发平台ModelArts-Wav2Lip训练基于DevServer适配PyTorch NPU训练指导(6.3.907):Step4 安装依赖和软件包

时间:2025-01-26 10:50:44

Step4 安装依赖和软件包

  1. 从github拉取Wav2Lip代码。
    cd /home/ma-usergit clone https://github.com/Rudrabha/Wav2Lip.gitcd /home/ma-user/Wav2Lipgit reset --hard f361e9527b917a435928a10

    如果出现报错SSL certificate problem: self signed certificate in certificate chain

    图1 报错SSL certificate problem

    可采取忽略SSL证书验证:使用以下命令来克隆仓库,它将忽略SSL证书验证。

    git clone -c http.sslVerify=false https://github.com/Rudrabha/Wav2Lip.git
  2. 安装Wav2Lip Ascend软件包。
    1. 将获取到的Wav2Lip Ascend软件包AscendCloud-AIGC-*.zip文件上传到容器的/home/ma-user目录下。获取路径:Support网站
    2. 解压AscendCloud-AIGC-*.zip文件,解压后将里面指定文件与对应Wave2Lip文件进行替换。
      cd  /home/ma-userunzip AscendCloud-AIGC-*.zip -d ./AscendCloudcp AscendCloud/multimodal_algorithm/Wav2Lip/train/f361e9527b917a435928a10/* /home/ma-user/Wav2Lip/rm -rf AscendCloud*

      AscendCloud-AIGC-*.zip后面的*表示时间戳,请按照实际替换。

      要替换的文件目录结构如下所示:
      |---Wav2Lip_code/       --- requirements.txt           #建议的依赖包版本注:需要对以下文件进行修改 --- color_syncnet_train.py     #训练expert discriminator唇形同步鉴别器 --- wav2lip_train.py           #训练 Wav2Lip 模型 --- preprocess.py              #对初始视频数据进行推理       在以上三个文件内import末尾增加import如下:          import torch_npu          from torch_npu.contrib import transfer_to_npu
  3. 安装Python依赖包,文件为requirements.txt文件。
    pip install -r requirements.txt
support.huaweicloud.com/bestpractice-modelarts/modelarts_wav2lip_0002.html