yerfor / GeneFacePlusPlus

GeneFace++: Generalized and Stable Real-Time 3D Talking Face Generation; Official Code
MIT License
1.59k stars 228 forks source link

Requirement Conflict #228

Open hTp34r opened 2 months ago

hTp34r commented 2 months ago

When I tried executing: ··· bash docs/prepare_env/install_ext.sh ··· It returned error which read 'The detected CUDA version (11.7) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions.' However, we are supposed to install CUDA 11.7 since in your install_guide-zh.md it said '我们推荐安装torch2.0.1+cuda11.7. 已经发现 torch=2.1+cuda12.1 会导致 torch-ngp 错误'. How should I do? My machine is Ubuntu 22.04 with CUDA 11.7.0 locally installed and conda environment with python=3.9

nitinmukesh commented 2 months ago

I am facing the same problem in Windows.

I know this is related to radnerfs as it is getting the CUDA version from Environment variables and not from conda environment. But what need to be done to fix this?

hTp34r commented 2 months ago

I am facing the same problem in Windows.

I know this is related to radnerfs as it is getting the CUDA version from Environment variables and not from conda environment. But what need to be done to fix this?

Sorry I'm also unsure about how to address it... qwq

nitinmukesh commented 2 months ago

The solution is the install the same CUDA version on your machine.

You can change it back to later version afterwards.

hTp34r commented 2 months ago

The solution is the install the same CUDA version on your machine.

You can change it back to later version afterwards.

Sorry but it doesn't work for me. Although I installed CUDA 11.7 on my computer both outside the conda environment and inside, some requirements that only support CUDA 12.1 were still automatically downloaded...

ishumilin commented 1 month ago

The conflict is caused by pip installing pytorch-lightning that depends on torch 2.5.0. Since pip has no idea of conda environment, it overrides torch that was installed earlier. Comment it out in requirements.txt and install it with conda before you run remaining pip commands. So:

cd <GeneFaceRoot>
source <CondaRoot>/bin/activate
conda create -n geneface python=3.9
conda activate geneface

conda install conda-forge::ffmpeg # ffmpeg with libx264 codec to turn images to video
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 pytorch3d -c pytorch -c nvidia -c pytorch3d
conda install lightning -c conda-forge

pip install cython
pip install openmim==0.3.9
mim install mmcv==2.1.0 # use mim to speed up installation for mmcv

sudo apt-get install libasound2-dev portaudio19-dev
pip install -r docs/prepare_env/requirements.txt -v

bash docs/prepare_env/install_ext.sh
ArindamRoy23 commented 4 weeks ago

@ishumilin Thanks a ton! Worked. Cant imagine how you figured that out.