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

shufflenetv2预训练的模型的问题 #246

Open
baibsB opened this issue Oct 25, 2023 · 1 comment
Open

shufflenetv2预训练的模型的问题 #246

baibsB opened this issue Oct 25, 2023 · 1 comment

Comments

@baibsB
Copy link

baibsB commented Oct 25, 2023

Traceback (most recent call last):
File "D:\pycharm\PyCharm Community Edition 2022.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\pycharm\PyCharm Community Edition 2022.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:\Python\Projects\MachineLearn\FibreDetect\yolov5-master-Shufflenetv2\train.py", line 632, in
main(opt)
File "D:\Python\Projects\MachineLearn\FibreDetect\yolov5-master-Shufflenetv2\train.py", line 526, in main
train(opt.hyp, opt, device, callbacks)
File "D:\Python\Projects\MachineLearn\FibreDetect\yolov5-master-Shufflenetv2\train.py", line 124, in train
csd = ckpt['model'].float().state_dict() # checkpoint state_dict as FP32
KeyError: 'model'

请问加载预训练模型时出现这个错误是为什么呢?

@ppogg
Copy link
Owner

ppogg commented Dec 12, 2023

这是一种常见的错误,出现在使用预训练模型加载时报错,建议打印模型的所有key进行比对~

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