visual-chatgpt icon indicating copy to clipboard operation
visual-chatgpt copied to clipboard

Installation failed on Windows

Open tam9life opened this issue 2 years ago • 4 comments

I tried the following. However, the following error occurs. ModuleNotFoundError: No module named 'ldm'

pip3 install ldm will result in the following error D:\ProgramData\Miniconda3\envs\visgpt\lib\site-packages\ldm.py:20 │ │ print self.face_rec_model_path SyntaxError: Missing parentheses in call to 'print'. Did you mean print(self.face_rec_model_path)?

Is there any way to work around this on Windows, mklink doesn't seem to be working as expected.

Run cmd as administrator

git clone https://github.com/microsoft/visual-chatgpt.git conda create -n visgpt python=3.8 --yes conda activate visgpt cd visual-chatgpt pip install -r requirement.txt git clone https://github.com/lllyasviel/ControlNet.git

mklink /D "\ldm" "\ControlNet\ldm" mklink /D "\cldm" "\ControlNet\cldm" mklink /D "\annotator" "\ControlNet\annotator"

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install wget a wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_canny.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_depth.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_hed.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_mlsd.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_normal.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_openpose.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_scribble.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_seg.pth cd ../../

setx OPENAI_API_KEY "sk-xxxxxx" mkdir image python visual_chatgpt.py

tam9life avatar Mar 09 '23 18:03 tam9life

You could just copypaste the https:// links into your browser and download the models somewhere (without the wget), then use a cmd like so to link your download folders:

mklink /D "C:\Users\me\where_i_want_stuff-folder" "I:\my-eleventh-ssd-for-ai-models\linked_models_folder_here"

Also, (dunno if setX is a thing) edit your environmental variables (just type that into "start" search) and make a new variable for the user (the top, NOT 'system variables'): OPENAI_API_KEY sk-XXXXXXXXXXXX

b2zer avatar Mar 09 '23 20:03 b2zer

If you must absolutely automate this, I think it can be done with bitsadmin (?) if I remember right. Actually, this is the perfect question to ask ChatGPT for. No kidding. It's really good with that (figuring out a batch.bat from a bat.sh and vice versa and everything else, too) - albeit you may have to occasionally use the thing between your ears to correct. And since you were gonna use it for this project, anyway - might as well. :-)

b2zer avatar Mar 09 '23 20:03 b2zer

I tried the following. However, the following error occurs. ModuleNotFoundError: No module named 'ldm'

pip3 install ldm will result in the following error D:\ProgramData\Miniconda3\envs\visgpt\lib\site-packages\ldm.py:20 │ │ print self.face_rec_model_path SyntaxError: Missing parentheses in call to 'print'. Did you mean print(self.face_rec_model_path)?

Is there any way to work around this on Windows, mklink doesn't seem to be working as expected.

Run cmd as administrator

git clone https://github.com/microsoft/visual-chatgpt.git conda create -n visgpt python=3.8 --yes conda activate visgpt cd visual-chatgpt pip install -r requirement.txt git clone https://github.com/lllyasviel/ControlNet.git

mklink /D "\ldm" "\ControlNet\ldm" mklink /D "\cldm" "\ControlNet\cldm" mklink /D "\annotator" "\ControlNet\annotator"

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install wget a wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_canny.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_depth.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_hed.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_mlsd.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_normal.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_openpose.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_scribble.pth wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/control_sd15_seg.pth cd ../../

setx OPENAI_API_KEY "sk-xxxxxx" mkdir image python visual_chatgpt.py

I'm stuck at the same spot. I followed your steps here to a tee, but Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) gave me an error. However, I downloaded the 8 .pth files and dropped them into the controlnet/models folder manually.

setx worked successfully, but getting SyntaxError: Missing parentheses in call to 'print'. Did you mean print(self.face_rec_model_path)? when running python visualchat-gpt.py

Did anyone ever figure out how to fix this?

itsWinwin avatar Mar 09 '23 22:03 itsWinwin

setx worked successfully, but getting SyntaxError: Missing parentheses in call to 'print'. Did you mean print(self.face_rec_model_path)? when running python visualchat-gpt.py

Did anyone ever figure out how to fix this?

Well, I think this is just a version problem of ldm. I also encountered this problem and I guess that the ldm we installed is only suitable for python 2.X. So, I just edited the source code of package ldm according to the package address of the error message from print self.face_rec_model_path to print(self.face_rec_model_path).

Note: There are other similar errors in the source code that can be modified

After modification, the error was removed.

ATang0729 avatar Mar 11 '23 05:03 ATang0729

Please try the new version to see whether the issue still occurs.

chenfei-wu avatar Mar 14 '23 03:03 chenfei-wu