# Missing keys & unexpected keys in state\_dict when loading self trained model

**URL:** <https://discuss.pytorch.org/t/missing-keys-unexpected-keys-in-state-dict-when-loading-self-trained-model/22379>\
**Category:** vision\
**Created:** [August 3, 2018, 11:43am UTC](https://discuss.pytorch.org/t/missing-keys-unexpected-keys-in-state-dict-when-loading-self-trained-model/22379 "2018-08-03T11:43:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stoneyang](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/stoneyang/32/5962_2.png) [@stoneyang](https://discuss.pytorch.org/u/stoneyang)\
**Post date:** [August 3, 2018, 12:46pm UTC](https://discuss.pytorch.org/t/missing-keys-unexpected-keys-in-state-dict-when-loading-self-trained-model/22379/2 "2018-08-03T12:46:54Z")

</div>

The Traceback:

```auto
Traceback (most recent call last):
  File "classifier.py", line 98, in <module>
    main(args)
  File "classifier.py", line 78, in main
    _im, im = Classifier(args.model).infer(args.image)
  File "classifier.py", line 48, in __init__
    arch.load_state_dict(checkpoint['state_dict'])
  File "/home/xxx/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict
    self. __class__. __name__ , "\n\t".join(error_msgs)))

```

---

_[View the full topic](https://discuss.pytorch.org/t/missing-keys-unexpected-keys-in-state-dict-when-loading-self-trained-model/22379)._
