neuralchen / SimSwap

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

I keep getting the error AttributeError: 'SGD' object has no attribute 'defaults' now? I never had this problem before #386

Closed jacobimatrix2 closed 1 year ago

jacobimatrix2 commented 1 year ago

Disclaimer: I'm not much of a coder, so please dumb down the solution for me :) I'm using this on Colab from this link

I don't know why, but recently I keep getting the error below. I looked it up on google and the only solution says to use !pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f but it still doesn't work. Thanks in advance!


AttributeError Traceback (most recent call last) in 14 15 torch.nn.Module.dump_patches = True ---> 16 model = create_model(opt) 17 model.eval() 18

5 frames /usr/local/lib/python3.8/dist-packages/torch/optim/optimizer.py in setstate(self, state) 82 def profile_hookstep(func): 83 ---> 84 @functools.wraps(func) 85 def wrapper(*args, *kwargs): 86 obj, = args

AttributeError: 'SGD' object has no attribute 'defaults'

tuanmaithanh123 commented 1 year ago

use this bro !pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

AmrKhalid666 commented 1 year ago

use this bro !pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

Thanks a lot man

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/.

Sg567 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/.

Explain in detail