gmongaras / AI_Girlfriend

Creating a waifu
MIT License
100 stars 31 forks source link

Stuck on step 4? #1

Open PortalTom opened 1 year ago

PortalTom commented 1 year ago

I can't seem to run the cells properly, and I don't understand what "The topmost cell can be uncommented to download the necessary packages and the versions that worked on my machine." means. Can someone please help me understand?

gmongaras commented 1 year ago

What error are you receiving when running the cells in main.ipynb?

PortalTom commented 1 year ago

Below are the errors that I am getting.

ModuleNotFoundError: No module named 'diffusers'

2 # memory_file = "config_file.json" NameError: name 'Girlfriend_Obj' is not defined

6 # Initialize the audio mixer NameError: name 'mixer' is not defined

Thank you for reading this.

gmongaras commented 1 year ago

For the ModuleNotFoundError: No module named 'diffusers' and NameError: name 'mixer' is not defined, you can run the first cell by uncommenting each line, or by highlighting the entire cell and pressing Ctrl+/ to uncomment the entire cell. After running the cell, all necessary packages should be installed! You can also copy and paste the following code in the first cell:

!pip install numpy==1.23.5
!pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1+cu116
!pip install diffusers==0.11.1
!pip install --ignore-installed Pillow==9.3.0
!pip install openai==0.26.4
!pip install SpeechRecognition==3.9.0
!pip install pygame==2.1.2
!pip install opencv-python==4.7.0.68
!pip install vosk==0.3.45
!pip install pydub==0.25.1
!pip install matplotlib==3.6.3
!pip install multiprocess==0.70.13
!pip install gradio==3.16.2
!pip install gtts==2.3.0
!pip install nltk==3.7
!pip install wave==0.0.2
!pip install transformers==4.25.1
!pip install keybert==0.7.0
!pip install rembg==2.0.30
!pip install accelerate
# PyAudio needs apt libraries first
!apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg
!pip install PyAudio==0.2.13
# nltk stuff
import nltk
nltk.download('vader_lexicon')
nltk.download('stopwords')

As for the NameError: name 'Girlfriend_Obj' is not defined, I'm guessing the import wasn't done successfully since the diffusers import failed. After pip installing the packages and restarting the kernel, the cells should be able to run properly!

gmongaras commented 1 year ago

You may also need to install PyTorch to utilize the GPU depending on your machine setup: https://pytorch.org/get-started/locally/

PortalTom commented 1 year ago

I have succeeded in running the first cell, but now I get the following errors instead:

ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu116 (from versions: 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0) ERROR: No matching distribution found for torch==1.13.1+cu116 ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\user\\anaconda3\\Lib\\site-packages\\PIL\\_imaging.cp39-win_amd64.pyd' Consider using the--useroption or check the permissions. ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. 'apt' is not recognized as an internal or external command, operable program or batch file.

Does anyone have any ideas about how I could fix the above errors?

I tried to install the correct version of torch with the following code in a cmd prompt, but it said that that version is not available. pip install torch==1.13.1+cu116

Thanks to anyone who replies to this.

gmongaras commented 1 year ago

Do you happen to have a GPU on your device?

PortalTom commented 1 year ago

Do you happen to have a GPU on your device?

Yes, I have a NVIDIA GeForce RTX 3060 Laptop GPU on my device.

gmongaras commented 1 year ago

Depending on what version of cuda you are running, you will have to install a different PyTorch version. You can check your version in your command line and typing nvcc --version

My version is Cuda 11.6, but yours may be different. Go to https://pytorch.org/get-started/locally/ and select the options that meet the specifics of your computer to download PyTorch.

PortalTom commented 1 year ago

Depending on what version of cuda you are running, you will have to install a different PyTorch version. You can check your version in your command line and typing nvcc --version

My version is Cuda 11.6, but yours may be different. Go to https://pytorch.org/get-started/locally/ and select the options that meet the specifics of your computer to download PyTorch.

I'm sorry to bother you again, but after installing Pytorch version 1.13.1 and Cuda 11.6 I still get the errors I listed above. Do you have any ideas as to what else the problem might be? Thanks.

gmongaras commented 1 year ago

Did you pip install the rest of the packages?

!pip install diffusers==0.11.1
!pip install --ignore-installed Pillow==9.3.0
!pip install openai==0.26.4
!pip install SpeechRecognition==3.9.0
!pip install pygame==2.1.2
!pip install opencv-python==4.7.0.68
!pip install vosk==0.3.45
!pip install pydub==0.25.1
!pip install matplotlib==3.6.3
!pip install multiprocess==0.70.13
!pip install gradio==3.16.2
!pip install gtts==2.3.0
!pip install nltk==3.7
!pip install wave==0.0.2
!pip install transformers==4.25.1
!pip install keybert==0.7.0
!pip install rembg==2.0.30
!pip install accelerate
# PyAudio needs apt libraries first
!apt install libasound2-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg
!pip install PyAudio==0.2.13

Also NLTK stuff

# nltk stuff
import nltk
nltk.download('vader_lexicon')
nltk.download('stopwords')

Also, I'm specifically using Ubuntu for WSL which is why I need the apt install. PyAudio is a little weird if you don't install the apt packages. If you are not using Ubuntu, you may have to find an alternative to get PyAudio to work if it acts up.

raccoonhands1 commented 1 year ago

Depending on what version of cuda you are running, you will have to install a different PyTorch version. You can check your version in your command line and typing nvcc --version My version is Cuda 11.6, but yours may be different. Go to https://pytorch.org/get-started/locally/ and select the options that meet the specifics of your computer to download PyTorch.

I'm sorry to bother you again, but after installing Pytorch version 1.13.1 and Cuda 11.6 I still get the errors I listed above. Do you have any ideas as to what else the problem might be? Thanks.

Did you happen to ever fix this issue? I've done everything but also cant seem to get the right torch setup

gmongaras commented 1 year ago

What error are you receiving? I was able to create a virtual environment, cloned the repository, install the necessary packages and didn't run into any issues. It looks like pip may have problems finding legacy packages though. So, instead of downloading a specific version, you can just download the latest version as follows (on the command line)

pip install numpy
pip install diffusers
pip install Pillow
pip install openai
pip install SpeechRecognition
pip install pygame
pip install opencv-python
pip install vosk
pip install pydub
pip install matplotlib
pip install multiprocess
pip install gradio
pip install gtts
pip install nltk
pip install wave
pip install transformers
pip install keybert
pip install rembg
pip install accelerate
pip install PyAudio

Note that PyTorch is not listed in the install list as PyTorch needs a special install. Go to the following link and download PyTorch here according to your system. I am on Windows, so the pip install looks as follows: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

However on a different machine with a different cuda version, the pip install may look different.