Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial: How to install on RTX 3XXX and higher. #572

Open
Echolink50 opened this issue Apr 20, 2023 · 31 comments
Open

Tutorial: How to install on RTX 3XXX and higher. #572

Echolink50 opened this issue Apr 20, 2023 · 31 comments
Labels
documentation Improvements or additions to documentation

Comments

@Echolink50
Copy link

Echolink50 commented Apr 20, 2023

Seems the install procedure is difficult for most and the people who know how have the most vague and short answers. I can't say this will work for everyone but this is what worked for me. My install is on Xeon E3 1240 V5, 16GB Ram, RTX 3060 TI 8GB, Windows 10. If you have a 1xxx or 2xxx series card I think you can just use the avatarify desktop install which is a simple .exe file.

First, make sure you have at least 10GB free space on your C drive AND the drive you are installing to if it's not the C drive. These github repos start downloading and extracting GBs of files only God knows where. Make sure you have a steady internet connection. Also make sure your computer meets the minimum requirements. Don't ask why it doesn't work on your 586 with voodoo gpu.

Watch this video and follow it except for the changes I mention: https://www.youtube.com/watch?v=lym9ANVb120

Go here and scroll to the section with Windows install instructions: https://github.com/alievk/avatarify-python/tree/master/docs
The same video is at the top.

Follow the instructions. Make a fresh start to prevent any previous attempts at install from complicating things.

  1. Install miniconda 3.8 where ever you want (mine is on the F: drive and this is where the env and huge lib files will be but it may also put some files on the C drive in appdata so I recommend using the C drive to avoid complications).

  2. Install git

  3. Create a folder somewhere that you want to install Avatarify. (like C:\Documents\Avatarify) Go to said folder and right click in the address bar and copy as text.

  4. Run Miniconda as Admin (just incase it wants to put files somewhere it needs privledges)

Click in Miniconda and type the drive where the folder you created in step 3 is located like this "F:" without the quotes. Your prompt should change to that drive letter. If your folder is on the C drive you don't have to type "C:" cause you are already on it. Now type "cd" then spacebar and paste the folder address you copied in step 3 and hit enter. Your prompt should change to indicate you are now in the folder you created.

  1. Paste this into the prompt "git clone https://github.com/alievk/avatarify-python.git" without the quotes. That should copy the files into the folder.

  2. Paste this into the prompt "cd avatarify-python" without the quotes. CD means change directory so now you should be into the folder with the files.

  3. Now open a file explorer and go to the folder you just git cloned. You should have some files there that need to be changed. Right click on the file and edit in notepad. These are the files that need to be changed and the changes I made. Edit requirements.txt in the main folder. Edit install_windows.bat which is in the scripts folder within the main folder. Make sure to save the changes and close the notepads. I used cudatoolkit 11.1 initially. Newer versions may work. Don't change run_windows.bat

Avatarify_Install_Instructions

install_windows.bat

@echo off

REM Check prerequisites
call conda --version >nul 2>&1 && ( echo conda found ) || ( echo conda not found. Please refer to the README and install Miniconda. && exit /B 1)
REM call git --version >nul 2>&1 && ( echo git found ) || ( echo git not found. Please refer to the README and install Git. && exit /B 1)

call scripts/settings_windows.bat

call conda create -y -n %CONDA_ENV_NAME% python=3.7
call conda activate %CONDA_ENV_NAME%

call mamba install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia -c conda-forge
call conda install -y scikit-image python-blosc -c conda-forge
call conda install -y -c anaconda git

REM ###FOMM###
call rmdir fomm /s /q
call git clone https://github.com/alievk/first-order-model.git fomm

call pip install -r requirements.txt

requirements.txt

opencv-python>=4.2.0.34
face-alignment==1.3.3
pyzmq==20.0.0
msgpack-numpy==0.4.7.1
pyyaml==5.4
requests==2.25.1
pyfakewebcam==0.1.0
  1. Go back to miniconda and make sure your prompt is still in the main folder. Run "conda install -c conda-forge mamba" without the quotes. Got this bit from Donvickins aswell as the modified script.

  2. Finally run "scripts\install_windows.bat" without the quotes. If it doesn't run make sure miniconda is in the right folder.

  3. Watch for everything to install. cuda is a 3GB download so it could take a while. Hit y whenever prompted. If your internet cuts out during the download like mine did run "scripts\install_windows.bat" again until it finishes. Let environment solving run. It took about 15 minutes for me. Hours seems excessive and maybe something didn't get installed properly.

  4. Download network weights and place vox-adv-cpk.pth.tar file in the avatarify-python directory (don't unpack it)

  5. Run "run_windows.bat" without the quotes. Make sure you have a camera attached. If it works, great, you're done. Now, for me I got an error here about cuda toolkit. I think its because my internet connection cut out during the cuda download/install. After the error I ran "conda install cudatoolkit" without the quotes which installed cuda toolkit 11.3. This worked but you can also specify a version. It probably has to be above 11.1 for RTX 3xxx cards.

That should be about it. I tried to write this as beginner friendly as possible. If this works for you please post a reply and confirm. Hope this helps.

@JohanAR JohanAR added the documentation Improvements or additions to documentation label Apr 20, 2023
@Oluwashawn
Copy link

those getting stuck at "solving environment" do this to fix it, while editing the "install_windows.bat" file, go to this line "call conda create -y -n %CONDA_ENV_NAME% python=3.7" and change the python version to the exact version installed on your pc i.e. if your python version is 3.10 then change the "3.7" to 3.10 etc...…if you are not sure of your python version you can run a separate miniconda tab and run "python -V" and you will see your python version.

@yungpalizawa
Copy link

How do I switch to NVIDIA GPU for more FPS? Avatarify has been using the CPU only which produces less than 3 FPS.

@JohanAR
Copy link
Collaborator

JohanAR commented Jun 8, 2023

@yungpalizawa it should use the GPU if you have all the dependencies installed and working. AFAIK it is CUDA that uses the best device it can find, so if it doesn't use your GPU you can look for resources about troubleshooting that.

@yungpalizawa
Copy link

@yungpalizawa it should use the GPU if you have all the dependencies installed and working. AFAIK it is CUDA that uses the best device it can find, so if it doesn't use your GPU you can look for resources about troubleshooting that.

Thank you. I got it fixed later, it was using pytorch but the cpu version. I had to uninstall and then redownload the pytorch-GPU version. Now I get at least 27 FPS.

@JohanAR
Copy link
Collaborator

JohanAR commented Jun 8, 2023

@yungpalizawa awesome! Avatarify-python isn't actively maintained, but if you know what to change in the install scripts to fix this then you could submit a PR if you want to.

@charliekodes
Copy link

I am having a lot of trouble installing Nvidia on my laptop after installing the script, I am at the stage of running the windows bag and it says I need Nvidia, I downloaded the exe but it keeps saying installation failed due to other installations are ongoing but am not installing anything

@yungpalizawa
Copy link

I am having a lot of trouble installing Nvidia on my laptop after installing the script, I am at the stage of running the windows bag and it says I need Nvidia, I downloaded the exe but it keeps saying installation failed due to other installations are ongoing but am not installing anything

Can you share your system's specifications?

@theofrizon
Copy link

how did you go about changing it from cpu to gpu. am having same issue on my 3060 graphics and 20series graphics card. exact same issue. everything else works.

@Oluwashawn
Copy link

you have to uninstall the current pytorch by runnning this (in your avatarify environment.....cd avatarify-python....etc)

pip uninstall torch

after install pytorch with cuda using this

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

@CharlesFranklin12
Copy link

Seems the install procedure is difficult for most and the people who know how have the most vague and short answers. I can't say this will work for everyone but this is what worked for me. My install is on Xeon E3 1240 V5, 16GB Ram, RTX 3060 TI 8GB, Windows 10. If you have a 1xxx or 2xxx series card I think you can just use the avatarify desktop install which is a simple .exe file.

First, make sure you have at least 10GB free space on your C drive AND the drive you are installing to if it's not the C drive. These github repos start downloading and extracting GBs of files only God knows where. Make sure you have a steady internet connection. Also make sure your computer meets the minimum requirements. Don't ask why it doesn't work on your 586 with voodoo gpu.

Watch this video and follow it except for the changes I mention: https://www.youtube.com/watch?v=lym9ANVb120

Go here and scroll to the section with Windows install instructions: https://github.com/alievk/avatarify-python/tree/master/docs The same video is at the top.

Follow the instructions. Make a fresh start to prevent any previous attempts at install from complicating things.

  1. Install miniconda 3.8 where ever you want (mine is on the F: drive and this is where the env and huge lib files will be but it may also put some files on the C drive in appdata so I recommend using the C drive to avoid complications).
  2. Install git
  3. Create a folder somewhere that you want to install Avatarify. (like C:\Documents\Avatarify) Go to said folder and right click in the address bar and copy as text.
  4. Run Miniconda as Admin (just incase it wants to put files somewhere it needs privledges)

Click in Miniconda and type the drive where the folder you created in step 3 is located like this "F:" without the quotes. Your prompt should change to that drive letter. If your folder is on the C drive you don't have to type "C:" cause you are already on it. Now type "cd" then spacebar and paste the folder address you copied in step 3 and hit enter. Your prompt should change to indicate you are now in the folder you created.

  1. Paste this into the prompt "git clone https://github.com/alievk/avatarify-python.git" without the quotes. That should copy the files into the folder.
  2. Paste this into the prompt "cd avatarify-python" without the quotes. CD means change directory so now you should be into the folder with the files.
  3. Now open a file explorer and go to the folder you just git cloned. You should have some files there that need to be changed. Right click on the file and edit in notepad. These are the files that need to be changed and the changes I made. Edit requirements.txt in the main folder. Edit install_windows.bat which is in the scripts folder within the main folder. Make sure to save the changes and close the notepads. I used cudatoolkit 11.1 initially. Newer versions may work. Don't change run_windows.bat

Avatarify_Install_Instructions

install_windows.bat

@echo off

REM Check prerequisites
call conda --version >nul 2>&1 && ( echo conda found ) || ( echo conda not found. Please refer to the README and install Miniconda. && exit /B 1)
REM call git --version >nul 2>&1 && ( echo git found ) || ( echo git not found. Please refer to the README and install Git. && exit /B 1)

call scripts/settings_windows.bat

call conda create -y -n %CONDA_ENV_NAME% python=3.7
call conda activate %CONDA_ENV_NAME%

call mamba install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia -c conda-forge
call conda install -y scikit-image python-blosc -c conda-forge
call conda install -y -c anaconda git

REM ###FOMM###
call rmdir fomm /s /q
call git clone https://github.com/alievk/first-order-model.git fomm

call pip install -r requirements.txt

requirements.txt

opencv-python>=4.2.0.34
face-alignment==1.3.3
pyzmq==20.0.0
msgpack-numpy==0.4.7.1
pyyaml==5.4
requests==2.25.1
pyfakewebcam==0.1.0
  1. Go back to miniconda and make sure your prompt is still in the main folder. Run "conda install -c conda-forge mamba" without the quotes. Got this bit from Donvickins aswell as the modified script.
  2. Finally run "scripts\install_windows.bat" without the quotes. If it doesn't run make sure miniconda is in the right folder.
  3. Watch for everything to install. cuda is a 3GB download so it could take a while. Hit y whenever prompted. If your internet cuts out during the download like mine did run "scripts\install_windows.bat" again until it finishes. Let environment solving run. It took about 15 minutes for me. Hours seems excessive and maybe something didn't get installed properly.
  4. Download network weights and place vox-adv-cpk.pth.tar file in the avatarify-python directory (don't unpack it)
  5. Run "run_windows.bat" without the quotes. Make sure you have a camera attached. If it works, great, you're done. Now, for me I got an error here about cuda toolkit. I think its because my internet connection cut out during the cuda download/install. After the error I ran "conda install cudatoolkit" without the quotes which installed cuda toolkit 11.3. This worked but you can also specify a version. It probably has to be above 11.1 for RTX 3xxx cards.

That should be about it. I tried to write this as beginner friendly as possible. If this works for you please post a reply and confirm. Hope this helps.

This is the error message I get when I run_windows.bat. pls help

1686239325.718170] Loading Predictor

Traceback (most recent call last): File "afy/cam fomm.py", line 218, in
**predictor_args
File "C:\Users\nzeme\avatarify-python\afy\predictor_local.py", line 49, in init
self.fa face alignment.FaceAlignment (face_alignment. LandmarksType._2D, Flip input=True, device=self.device) File "C:\Users\nzeme\miniconda3/envs\avatarify\lib\enum.py", line 354, in getattr raise AttributeError(name) from None
AttributeError: 2D

@CharlesFranklin12
Copy link

you have to uninstall the current pytorch by runnning this (in your avatarify environment.....cd avatarify-python....etc)

pip uninstall torch

after install pytorch with cuda using this

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

The error message I get when I run_windows.bat

1686239325.718170] Loading Predictor

Traceback (most recent call last): File "afy/cam fomm.py", line 218, in
**predictor_args
File "C:\Users\nzeme\avatarify-python\afy\predictor_local.py", line 49, in init
self.fa face alignment.FaceAlignment (face_alignment. LandmarksType._2D, Flip input=True, device=self.device) File "C:\Users\nzeme\miniconda3/envs\avatarify\lib\enum.py", line 354, in getattr raise AttributeError(name) from None
AttributeError: 2D

@MICKYGEM
Copy link

MICKYGEM commented Jul 31, 2023 via email

@engrmarcel
Copy link

Check my video on YouTube or send message to WhatsApp
On Sun, 30 Jul 2023 at 10:43 AM, CharlesFranklin12 @.**> wrote: you have to uninstall the current pytorch by runnning this (in your avatarify environment.....cd avatarify-python....etc) pip uninstall torch after install pytorch with cuda using this pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116 The error message I get when I run_windows.bat 1686239325.718170] Loading Predictor Traceback (most recent call last): File "afy/cam fomm.py", line 218, in predictor_args File "C:\Users\nzeme\avatarify-python\afy\predictor_local.py", line 49, in init self.fa face alignment.FaceAlignment (face_alignment. LandmarksType._2D, Flip input=True, device=self.device) File "C:\Users\nzeme\miniconda3/envs\avatarify\lib\enum.py", line 354, in getattr raise AttributeError(name) from None AttributeError: 2D — Reply to this email directly, view it on GitHub <#572 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKL6YJ3A6FFBJP3MC3JNSP3XSYUEFANCNFSM6AAAAAAXE7LASY . You are receiving this because you are subscribed to this thread.Message ID: @.>
-- MICKYGEM💎

i am having same issue. Where is the video link?

@prom123456
Copy link

Seems the install procedure is difficult for most and the people who know how have the most vague and short answers. I can't say this will work for everyone but this is what worked for me. My install is on Xeon E3 1240 V5, 16GB Ram, RTX 3060 TI 8GB, Windows 10. If you have a 1xxx or 2xxx series card I think you can just use the avatarify desktop install which is a simple .exe file.

First, make sure you have at least 10GB free space on your C drive AND the drive you are installing to if it's not the C drive. These github repos start downloading and extracting GBs of files only God knows where. Make sure you have a steady internet connection. Also make sure your computer meets the minimum requirements. Don't ask why it doesn't work on your 586 with voodoo gpu.

Watch this video and follow it except for the changes I mention: https://www.youtube.com/watch?v=lym9ANVb120

Go here and scroll to the section with Windows install instructions: https://github.com/alievk/avatarify-python/tree/master/docs The same video is at the top.

Follow the instructions. Make a fresh start to prevent any previous attempts at install from complicating things.

  1. Install miniconda 3.8 where ever you want (mine is on the F: drive and this is where the env and huge lib files will be but it may also put some files on the C drive in appdata so I recommend using the C drive to avoid complications).
  2. Install git
  3. Create a folder somewhere that you want to install Avatarify. (like C:\Documents\Avatarify) Go to said folder and right click in the address bar and copy as text.
  4. Run Miniconda as Admin (just incase it wants to put files somewhere it needs privledges)

Click in Miniconda and type the drive where the folder you created in step 3 is located like this "F:" without the quotes. Your prompt should change to that drive letter. If your folder is on the C drive you don't have to type "C:" cause you are already on it. Now type "cd" then spacebar and paste the folder address you copied in step 3 and hit enter. Your prompt should change to indicate you are now in the folder you created.

  1. Paste this into the prompt "git clone https://github.com/alievk/avatarify-python.git" without the quotes. That should copy the files into the folder.
  2. Paste this into the prompt "cd avatarify-python" without the quotes. CD means change directory so now you should be into the folder with the files.
  3. Now open a file explorer and go to the folder you just git cloned. You should have some files there that need to be changed. Right click on the file and edit in notepad. These are the files that need to be changed and the changes I made. Edit requirements.txt in the main folder. Edit install_windows.bat which is in the scripts folder within the main folder. Make sure to save the changes and close the notepads. I used cudatoolkit 11.1 initially. Newer versions may work. Don't change run_windows.bat

Avatarify_Install_Instructions

install_windows.bat

@echo off

REM Check prerequisites
call conda --version >nul 2>&1 && ( echo conda found ) || ( echo conda not found. Please refer to the README and install Miniconda. && exit /B 1)
REM call git --version >nul 2>&1 && ( echo git found ) || ( echo git not found. Please refer to the README and install Git. && exit /B 1)

call scripts/settings_windows.bat

call conda create -y -n %CONDA_ENV_NAME% python=3.7
call conda activate %CONDA_ENV_NAME%

call mamba install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia -c conda-forge
call conda install -y scikit-image python-blosc -c conda-forge
call conda install -y -c anaconda git

REM ###FOMM###
call rmdir fomm /s /q
call git clone https://github.com/alievk/first-order-model.git fomm

call pip install -r requirements.txt

requirements.txt

opencv-python>=4.2.0.34
face-alignment==1.3.3
pyzmq==20.0.0
msgpack-numpy==0.4.7.1
pyyaml==5.4
requests==2.25.1
pyfakewebcam==0.1.0
  1. Go back to miniconda and make sure your prompt is still in the main folder. Run "conda install -c conda-forge mamba" without the quotes. Got this bit from Donvickins aswell as the modified script.
  2. Finally run "scripts\install_windows.bat" without the quotes. If it doesn't run make sure miniconda is in the right folder.
  3. Watch for everything to install. cuda is a 3GB download so it could take a while. Hit y whenever prompted. If your internet cuts out during the download like mine did run "scripts\install_windows.bat" again until it finishes. Let environment solving run. It took about 15 minutes for me. Hours seems excessive and maybe something didn't get installed properly.
  4. Download network weights and place vox-adv-cpk.pth.tar file in the avatarify-python directory (don't unpack it)
  5. Run "run_windows.bat" without the quotes. Make sure you have a camera attached. If it works, great, you're done. Now, for me I got an error here about cuda toolkit. I think its because my internet connection cut out during the cuda download/install. After the error I ran "conda install cudatoolkit" without the quotes which installed cuda toolkit 11.3. This worked but you can also specify a version. It probably has to be above 11.1 for RTX 3xxx cards.

That should be about it. I tried to write this as beginner friendly as possible. If this works for you please post a reply and confirm. Hope this helps.

this helped me

@advaking1
Copy link

please help got this issue and did

pip uninstall torch

after install pytorch with cuda using this

pip install torch torchvision torchaudio --extra-index-url
https://download.pytorch.org/whl/cu116

but still gave same issue

@SanPatrick01
Copy link

What issue ?

@SanPatrick01
Copy link

Send pictures or video to my dm

@advaking1
Copy link

Capture11

this is the issue

@SanPatrick01
Copy link

Sent to WhatsApp

@advaking1
Copy link

i dont have ur whatsapp

@SanPatrick01
Copy link

‪+234 811 513 3627‬

@Aut85
Copy link

Aut85 commented Feb 11, 2024

have the same problem please i need helps

@Aut85
Copy link

Aut85 commented Feb 11, 2024

Uploading Screenshot 2024-02-11 030146.png…

@Aut85
Copy link

Aut85 commented Feb 11, 2024

Screenshot 2024-02-11 030146

@SanPatrick01
Copy link

What problem

@SanPatrick01
Copy link

Downlaod anydesk and send pic or video to my whatsappp

‪+234 811 513 3627‬

@innodollars
Copy link

@yungpalizawa it should use the GPU if you have all the dependencies installed and working. AFAIK it is CUDA that uses the best device it can find, so if it doesn't use your GPU you can look for resources about troubleshooting that.

Thank you. I got it fixed later, it was using pytorch but the cpu version. I had to uninstall and then redownload the pytorch-GPU version. Now I get at least 27 FPS.

please i need help i have rtx 4060 yet am stuck at 3 fps

@Oluwashawn
Copy link

@yungpalizawa it should use the GPU if you have all the dependencies installed and working. AFAIK it is CUDA that uses the best device it can find, so if it doesn't use your GPU you can look for resources about troubleshooting that.

Thank you. I got it fixed later, it was using pytorch but the cpu version. I had to uninstall and then redownload the pytorch-GPU version. Now I get at least 27 FPS.

please i need help i have rtx 4060 yet am stuck at 3 fps

You're stick at 3 fps because it is using CPU pytorch , here's how to fix it

Uninstall pytorch using this code in your avatarify

After you type "CD avatarify"

Type "pip uninstall pytorch"

Then accept , once it is done uninstalling the pytorch
you will install a GPU pytorch using this code

"pip install torch -f https://download.pytorch.org/whl/torch_stable.html"

It will download about 3.9gb of data be patient and after which your avatar should run with the gpu @ 22 to 30fps depending on your GPU

If you get any L*******"".lib has been initialized error after installing the gpu pytorch, hit me up on Whatsapp +2348140718484

@Nene020
Copy link

Nene020 commented Jun 12, 2024

Nvidia 30 and 40 series
Dm on telegram @King_Gabos

@yesitsni
Copy link

yesitsni commented Dec 8, 2024

Capture11

this is the issue

Just type Pip install Modules

@yesitsni
Copy link

yesitsni commented Dec 8, 2024

Screenshot 2024-02-11 030146

Pip install requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

17 participants