# RuntimeError: Error(s) in loading state\_dict for DenseNet: Unexpected key(s) in state\_dict

**URL:** <https://discuss.pytorch.org/t/runtimeerror-error-s-in-loading-state-dict-for-densenet-unexpected-key-s-in-state-dict/31117>\
**Category:** Uncategorized\
**Created:** [December 3, 2018, 4:46am UTC](https://discuss.pytorch.org/t/runtimeerror-error-s-in-loading-state-dict-for-densenet-unexpected-key-s-in-state-dict/31117 "2018-12-03T04:46:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [December 3, 2018, 3:41pm UTC](https://discuss.pytorch.org/t/runtimeerror-error-s-in-loading-state-dict-for-densenet-unexpected-key-s-in-state-dict/31117/2 "2018-12-03T15:41:57Z")

</div>

It looks like you are using an older PyTorch version to load the model.  
Have a look at [this thread](https://discuss.pytorch.org/t/unexpected-key-in-state-dict-bn1-num-batches-tracked/29454?u=ptrblck) for possible solutions.

---

_[View the full topic](https://discuss.pytorch.org/t/runtimeerror-error-s-in-loading-state-dict-for-densenet-unexpected-key-s-in-state-dict/31117)._
