# Error(s) in loading state\_dict for ConvNet

**URL:** <https://discuss.pytorch.org/t/error-s-in-loading-state-dict-for-convnet/26784>\
**Category:** vision\
**Created:** [October 8, 2018, 2:40pm UTC](https://discuss.pytorch.org/t/error-s-in-loading-state-dict-for-convnet/26784 "2018-10-08T14:40:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![InnovArul](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/innovarul/32/5282_2.png) [@InnovArul](https://discuss.pytorch.org/u/InnovArul)\
**Post date:** [October 8, 2018, 10:19pm UTC](https://discuss.pytorch.org/t/error-s-in-loading-state-dict-for-convnet/26784/2 "2018-10-08T22:19:51Z")

</div>

seems related to this:

> [@\[SOLVED\] Unexpected key(s) in state\_dict: batches\_tracked"](https://discuss.pytorch.org/t/solved-unexpected-key-s-in-state-dict-batches-tracked/23884):
>
> I am getting this error when I am loading the weights for a model I trained on a GPU. I am trying to load the model on a CPU. Not sure what this error means. I did check the checkpoint[‘state\_dict’] keys and it does contain this ‘num\_batches\_tracked’ key for all the batch normalization layers. I am using the same model on the CPU as I trained on the GPU. I am training a UNet model. checkpoint = torch.load(‘model\_best.pth-zeromask-notconsider.tar’,map\_location=lambda storage, loc: storage) …

---

_[View the full topic](https://discuss.pytorch.org/t/error-s-in-loading-state-dict-for-convnet/26784)._
