cat /etc/centos-release
uname -asudo yum groupinstall "Development Tools" -y
sudo yum install -y \
cmake \
git \
wget \
unzip \
ffmpeg \
sox \
portaudio⚠️ GeneFace 依赖 ffmpeg,CentOS 自带版本可能太老,建议装 ffmpeg 4+不要直接用系统 Python
推荐:
conda 管理# 安装 Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh创建环境:
conda create -n geneface python=3.9 -y
conda activate geneface如果是 NVIDIA GPU:
conda install pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorchCPU 版本(不推荐,慢):
conda install pytorch torchvision torchaudio cpuonly -c pytorch验证:
import torch
print(torch.cuda.is_available())GeneFace 常用依赖(示例):
pip install numpy scipy matplotlib
pip install librosa soundfile
pip install opencv-python
pip install tqdm yaml argparse
pip install scikit-image可能需要:
pip install face-alignment
pip install pytorch3d # 非常难装⚠️pytorch3d在 CentOS 上编译极易失败
建议:
conda install pytorch3d -c pytorch3dpip install pyworld
pip install nltknvidia-smiyum groupinstall "Chinese Support"| 问题 | 原因 | 解决 |
|---|---|---|
| glibc 版本低 | CentOS 7 | 用 conda |
| ffmpeg 太老 | yum 源旧 | 编译或 conda |
| pytorch3d 编译失败 | 编译器问题 | conda 安装 |
| 中文路径乱码 | 编码问题 | UTF-8 |
CentOS
├─ Miniconda
├─ Python 3.9
├─ PyTorch + CUDA
├─ ffmpeg
├─ GeneFace 代码
└─ pip/conda 安装依赖如果你愿意,我可以:
你现在是 CentOS 几 + 有没有 GPU?