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

咨询下,该报错怎么解决? #15

Open
zhanghaobucunzai opened this issue Jun 23, 2021 · 1 comment
Open

咨询下,该报错怎么解决? #15

zhanghaobucunzai opened this issue Jun 23, 2021 · 1 comment

Comments

@zhanghaobucunzai
Copy link

../models/google/inception3_spg.py:137: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
nn.init.xavier_uniform(m.weight.data)
=> loading checkpoint '../models/inception_v3_google-1a9a5a14.pth'
KeyError
Traceback (most recent call last):
File "../utils/Restore.py", line 24, in restore
args.current_epoch = checkpoint['epoch'] + 1
KeyError: 'epoch'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_frame.py", line 194, in
train(args)
File "train_frame.py", line 98, in train
model, optimizer= get_model(args)
File "train_frame.py", line 88, in get_model
restore(args, model, optimizer, including_opt=False)
File "../utils/Restore.py", line 38, in restore
_model_load(model, checkpoint)
File "../utils/Restore.py", line 51, in _model_load
if model_dict.keys()[0].startswith('module.'):
TypeError: 'odict_keys' object is not subscriptable

@xiaomengyc
Copy link
Owner

The checkpoint is not correctly loaded. Place the checkpoint at the right location or change the path to the checkpoint.

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

2 participants