neuralchen / SimSwap

An arbitrary face-swapping framework on images and videos with one single trained model!
Other
4.52k stars 892 forks source link

sgd' object has no attribute 'defaults' error #375

Closed hemsflame closed 1 year ago

hemsflame commented 1 year ago

can someone help me with this issue on colab

2022-12-28 21_04_00-Window

Someonetoldme584 commented 1 year ago

same issuie

CoderDudeBrent commented 1 year ago

Ok I think I may have got mine working!

I noticed that under my SimSwap folder on the left, I saw another, so I expanded. it was a duplicate. and inside that was another. I ended up closing out, opened a fresh version, copied a version to my own drive. Opened that and ran it. before I ran anything I added the line in the 3rd cell,

!pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

then I ran through the courses of running each cell one by one until I reached the last cell that actually took the video and the image and started compiling. Its currently compiling with no errors.

I hope my explanation is helpful.

orlandomendozagarrido commented 1 year ago

image I fixed it, ... I found that by !pip install torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html just copy paste that line into the installation cell like in my first image I placed in the second line and it will run compatible with torchtext 0.14.0 then run the rest of the cells like normally image

Bobby606 commented 1 year ago

after so many research this is what worked for me

!

Screenshot (1)

i erased !pip install insightface==0.2.1 onnxruntime moviepy !pip install googledrivedownloader !pip install imageio==2.4.1 from its cell

Screenshot

and replaced with !pip install insightface==0.2.1 onnxruntime==1.10.0 onnx==1.11.0 moviepy !pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html !pip install googledrivedownloader !pip install imageio==2.4.1 and then i clicked the play button the first time.

Screenshot(3)

it gave me an error at saying " ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torchtext 0.14.1 requires torch==1.13.1, but you have torch 1.8.1+cu111 which is incompatible. "

Screenshot(1)

so i clicked the play button again, and there was no error.

Screenshot(4)

and everything just went smoothly , and i never had the " sgd' object has no attribute 'defaults' " error again. and i got my "output demo" successfully.

i can't guarantee it would work for everyone.

Bobby606 commented 1 year ago

i just want to know how to run the sim swap 512 higher resolution version without any errors

neuralchen commented 1 year ago

We fixed the "AttributeError: 'SGD' object has no attribute 'defaults' now" bug. If you have already downloaded arcface_checkpoint.tar, please download it again. Also, you also need to update the scripts in ./models/.