SimSwap icon indicating copy to clipboard operation
SimSwap copied to clipboard

TypeError: 'ResNet' object is not subscriptable'

Open 110728 opened this issue 2 years ago • 5 comments

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'

110728 avatar May 06 '23 07:05 110728

I also encountered the same problem.

lienpeng-390 avatar May 06 '23 09:05 lienpeng-390

image

lienpeng-390 avatar May 06 '23 09:05 lienpeng-390

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?

lienpeng-390 avatar May 08 '23 13:05 lienpeng-390

hello , have anyone fixed this problem ? many thanks

WandererGuy avatar May 11 '23 07:05 WandererGuy

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

WandererGuy avatar May 11 '23 16:05 WandererGuy