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

Open
opened 2023-05-06 09:18:23 +02:00 by 110728 · 5 comments
110728 commented 2023-05-06 09:18:23 +02:00 (Migrated from github.com)

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'

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 2023-05-06 11:16:12 +02:00 (Migrated from github.com)

I also encountered the same problem.

I also encountered the same problem.
lienpeng-390 commented 2023-05-06 11:17:09 +02:00 (Migrated from github.com)
image
<img width="572" alt="image" src="https://user-images.githubusercontent.com/64118305/236615232-3e5e3721-4acb-4a42-98fb-f3db060ebf98.png">
lienpeng-390 commented 2023-05-08 15:07:53 +02:00 (Migrated from github.com)

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?

> 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 2023-05-11 09:04:17 +02:00 (Migrated from github.com)

hello , have anyone fixed this problem ? many thanks

hello , have anyone fixed this problem ? many thanks
WandererGuy commented 2023-05-11 18:05:16 +02:00 (Migrated from github.com)

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

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
Sign in to join this conversation.