neuralchen / SimSwap

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

TypeError: 'ResNet' object is not subscriptable' #404

Open 110728 opened 1 year ago

110728 commented 1 year ago

When I run the program using Colab demo and follow the author's instructions to update the code, I encounter the error 'TypeError: 'ResNet' object is not subscriptable'

lienpeng-390 commented 1 year ago

I also encountered the same problem.

lienpeng-390 commented 1 year ago
image
lienpeng-390 commented 1 year ago

When I run the program using Colab demo and follow the author's instructions to update the code, I encounter the error 'TypeError: 'ResNet' object is not subscriptable'

Hello, have you solved this problem?

WandererGuy commented 1 year ago

hello , have anyone fixed this problem ? many thanks

WandererGuy commented 1 year ago

in projected_model.py , you can fix ' self.netArc = netArc_checkpoint['model'].module' to ' self.netArc = netArc_checkpoint' , i think due to new 'arcface_checkpoint.tar' which author update to solve SGD problem makes ResNet not subscriptable anymore. My fix is inspired from author change in fs_model.py in update of SGD problem from ' self.netArc = netArc_checkpoint['model'].module' to 'self.netArc = netArc_checkpoint' , also train.py depends on projected_model.py so i change projected_model.py like i showed. I still new to this so might not be right, but it helps me overcome this bug , hope it helps you too. p/s: im using unzipped vggface2_crop_arcfacealign_224.tar to train