How to setup dependencies for github... this is what worked for me on 18/7/2023 #433

Open
opened 2023-07-18 12:10:17 +02:00 by nghiap · 10 comments
nghiap commented 2023-07-18 12:10:17 +02:00 (Migrated from github.com)

(simswap) C:\SimSwap-main>cd\
(simswap) C:\SimSwap-main>cd simswap-main
(simswap) C:\SimSwap-main>conda create -n simswap python=3.8
(simswap) C:\SimSwap-main>conda activate simswap
(simswap) C:\SimSwap-main>set CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
(simswap) C:\SimSwap-main>conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
(simswap) C:\SimSwap-main>conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch
(simswap) C:\SimSwap-main>pip install --ignore-installed imageio
(simswap) C:\SimSwap-main>conda install cudatoolkit -c pytorch
(simswap) C:\SimSwap-main>pip install "numpy<1.24"
(simswap) C:\SimSwap-main>pip install insightface==0.2.1 onnxruntime moviepy

(simswap) C:\SimSwap-main>cd\ (simswap) C:\SimSwap-main>cd simswap-main (simswap) C:\SimSwap-main>conda create -n simswap python=3.8 (simswap) C:\SimSwap-main>conda activate simswap (simswap) C:\SimSwap-main>set CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON" (simswap) C:\SimSwap-main>conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia (simswap) C:\SimSwap-main>conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch (simswap) C:\SimSwap-main>pip install --ignore-installed imageio (simswap) C:\SimSwap-main>conda install cudatoolkit -c pytorch (simswap) C:\SimSwap-main>pip install "numpy<1.24" (simswap) C:\SimSwap-main>pip install insightface==0.2.1 onnxruntime moviepy
joaoesp commented 2023-07-29 17:24:43 +02:00 (Migrated from github.com)

did you use anaconda or miniconda? its so frustrating to try and make this work, just errors after errors...

did you use anaconda or miniconda? its so frustrating to try and make this work, just errors after errors...
nghiap commented 2023-07-29 21:49:24 +02:00 (Migrated from github.com)

I used anaconda 3.
I have old inspiron 5000, Nvidia graphics gtx1065. If you have different graphic card may need to do different install steps for torch install.

I used anaconda 3. I have old inspiron 5000, Nvidia graphics gtx1065. If you have different graphic card may need to do different install steps for torch install.
joaoesp commented 2023-07-30 10:06:45 +02:00 (Migrated from github.com)

I have a Geforce GTX 1070 and couldnt get it running with cuda 12.2.
Im just trying to run it on CPU now, getting it to run on GPU is a nightmare, I had it running on CPU before and I tried to install the packages to run it on GPU and it broke everything. Trying to get it running again...

I have a Geforce GTX 1070 and couldnt get it running with cuda 12.2. Im just trying to run it on CPU now, getting it to run on GPU is a nightmare, I had it running on CPU before and I tried to install the packages to run it on GPU and it broke everything. Trying to get it running again...
nghiap commented 2023-07-30 23:06:43 +02:00 (Migrated from github.com)

Hi Joaoesp,
if you still have problem when you have followed my steps above, then check and make sure you have correct version of CUDA and CUDNN as mentioned in the GPU requirements that suits your GTX card before following the steps I posted.

Also look at this page to see what commands to use for the pytorch version you will install, if you want to use different version
https://pytorch.org/get-started/previous-versions/

there you will also see what cudatoolkit version you need and from there get the right version of CUDA and CUDNN ready before you start the conda enviroment and installation of simswap requirepment.

Hi Joaoesp, if you still have problem when you have followed my steps above, then check and make sure you have correct version of CUDA and CUDNN as mentioned in the GPU requirements that suits your GTX card before following the steps I posted. Also look at this page to see what commands to use for the pytorch version you will install, if you want to use different version https://pytorch.org/get-started/previous-versions/ there you will also see what cudatoolkit version you need and from there get the right version of CUDA and CUDNN ready before you start the conda enviroment and installation of simswap requirepment.
joaoesp commented 2023-08-10 16:02:49 +02:00 (Migrated from github.com)

GPU: 4060 8gb
Cuda: 11.8

its stuck on ---- END ---- doesnt move forward, have to close the window.

I tried: #120 but then it gives me:

-------------- End ----------------
(142, 366, 4)
Traceback (most recent call last):
File "test_wholeimage_swapsingle.py", line 51, in
model = create_model(opt)
File "C:\Users\Joaoesp\Documents\SimSwap\SimSwap-main\models\models.py", line 18, in create_model
model.initialize(opt)
File "C:\Users\Joaoesp\Documents\SimSwap\SimSwap-main\models\fs_model.py", line 67, in initialize
netArc_checkpoint = torch.load(netArc_checkpoint)
File "C:\Users\Joaoesp\anaconda3\envs\simswap\lib\site-packages\torch\serialization.py", line 592, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "C:\Users\Joaoesp\anaconda3\envs\simswap\lib\site-packages\torch\serialization.py", line 851, in _load
result = unpickler.load()
ModuleNotFoundError: No module named 'models.arcface_models'

GPU: 4060 8gb Cuda: 11.8 its stuck on ---- END ---- doesnt move forward, have to close the window. I tried: #120 but then it gives me: -------------- End ---------------- (142, 366, 4) Traceback (most recent call last): File "test_wholeimage_swapsingle.py", line 51, in <module> model = create_model(opt) File "C:\Users\Joaoesp\Documents\SimSwap\SimSwap-main\models\models.py", line 18, in create_model model.initialize(opt) File "C:\Users\Joaoesp\Documents\SimSwap\SimSwap-main\models\fs_model.py", line 67, in initialize netArc_checkpoint = torch.load(netArc_checkpoint) File "C:\Users\Joaoesp\anaconda3\envs\simswap\lib\site-packages\torch\serialization.py", line 592, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "C:\Users\Joaoesp\anaconda3\envs\simswap\lib\site-packages\torch\serialization.py", line 851, in _load result = unpickler.load() ModuleNotFoundError: No module named 'models.arcface_models'
nghiap commented 2023-08-11 05:59:00 +02:00 (Migrated from github.com)

I think you should start a new conda environment and follow the steps I pasted at the beginning. Make sure you have the necessary model in checkpoint and download the archface file like they stated in the SimSwap Github. If you are going with pytorch-cuda=11.8, then make sure your NVidia toolset & Cudnn are of suitable version that works with cuda 11.8.

I think you should start a new conda environment and follow the steps I pasted at the beginning. Make sure you have the necessary model in checkpoint and download the archface file like they stated in the SimSwap Github. If you are going with pytorch-cuda=11.8, then make sure your NVidia toolset & Cudnn are of suitable version that works with cuda 11.8.
joaoesp commented 2023-08-11 12:40:50 +02:00 (Migrated from github.com)

I did follow your steps, I downloaded the cudnn for 11.x cuda, torch.cuda.is_available returns true and device_count returns 1.
I am still getting the problem stated above. Thank you for helping.

I did follow your steps, I downloaded the cudnn for 11.x cuda, torch.cuda.is_available returns true and device_count returns 1. I am still getting the problem stated above. Thank you for helping.
joaoesp commented 2023-08-11 12:54:15 +02:00 (Migrated from github.com)

I re-downloaded the repository and it worked! Ty so much for your help!

I re-downloaded the repository and it worked! Ty so much for your help!
nghiap commented 2023-08-11 23:32:21 +02:00 (Migrated from github.com)

That's great! Congratulations.

From: joaoesp @.>
Sent: Friday, August 11, 2023 10:54 PM
To: neuralchen/SimSwap @.
>
Cc: nghiap @.>; Author @.>
Subject: Re: [neuralchen/SimSwap] How to setup dependencies for github... this is what worked for me on 18/7/2023 (Issue #433)

I re-downloaded the repository and it worked! Ty so much for your help!

Reply to this email directly, view it on GitHubhttps://github.com/neuralchen/SimSwap/issues/433#issuecomment-1674561798, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFBHH34GGYTOH7LQ6JO2J7DXUYFOFANCNFSM6AAAAAA2OFCLFI.
You are receiving this because you authored the thread.Message ID: @.@.>>

That's great! Congratulations. From: joaoesp ***@***.***> Sent: Friday, August 11, 2023 10:54 PM To: neuralchen/SimSwap ***@***.***> Cc: nghiap ***@***.***>; Author ***@***.***> Subject: Re: [neuralchen/SimSwap] How to setup dependencies for github... this is what worked for me on 18/7/2023 (Issue #433) I re-downloaded the repository and it worked! Ty so much for your help! - Reply to this email directly, view it on GitHub<https://github.com/neuralchen/SimSwap/issues/433#issuecomment-1674561798>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFBHH34GGYTOH7LQ6JO2J7DXUYFOFANCNFSM6AAAAAA2OFCLFI>. You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
Rbionewer commented 2024-09-24 07:38:31 +02:00 (Migrated from github.com)

Thankyou very much! from 2024

Thankyou very much! from 2024
Sign in to join this conversation.