Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why there are vgg16 in upocr? #4

Open
HERIUN opened this issue Oct 31, 2024 · 0 comments
Open

why there are vgg16 in upocr? #4

HERIUN opened this issue Oct 31, 2024 · 0 comments

Comments

@HERIUN
Copy link

HERIUN commented Oct 31, 2024

Thanks for your great work.

I trained model and I found that vgg16 is in upocr. but, in forward process upocr don't use vgg16 at all.

so, when loading my trained model, there are key error(trained model has vgg16, but eval process, vgg16 is disabled..)

def build(args):
    encoder = build_encoder(args)
    decoder = build_decoder(args)
    vgg16 = build_vgg16(args) if not args.eval else None
    ...

so I delete vgg16 my trained model ckpt in class Checkpointer(object) in def load

if self.distributed:
    model = model.module
keys_to_delete = [key for key in checkpoint['model'] if key.startswith('vgg16')]
for key in keys_to_delete:
        del checkpoint['model'][key]
model.load_state_dict(checkpoint['model'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant