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

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

Open
nghiap opened this issue Jul 18, 2023 · 9 comments

Comments

@nghiap
Copy link

nghiap commented Jul 18, 2023

(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
Copy link

joaoesp commented Jul 29, 2023

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

@nghiap
Copy link
Author

nghiap commented Jul 29, 2023

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
Copy link

joaoesp commented Jul 30, 2023

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
Copy link
Author

nghiap commented Jul 30, 2023

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
Copy link

joaoesp commented Aug 10, 2023

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'

@nghiap
Copy link
Author

nghiap commented Aug 11, 2023

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
Copy link

joaoesp commented Aug 11, 2023

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
Copy link

joaoesp commented Aug 11, 2023

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

@nghiap
Copy link
Author

nghiap commented Aug 11, 2023 via email

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

No branches or pull requests

2 participants