# How to import caffe2 weights in pytorch?

**URL:** <https://discuss.pytorch.org/t/how-to-import-caffe2-weights-in-pytorch/117195>\
**Category:** Uncategorized\
**Created:** [April 6, 2021, 6:46am UTC](https://discuss.pytorch.org/t/how-to-import-caffe2-weights-in-pytorch/117195 "2021-04-06T06:46:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tejal567](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/t/71c47a/32.png) [@tejal567](https://discuss.pytorch.org/u/tejal567)\
**Post date:** [April 6, 2021, 6:46am UTC](https://discuss.pytorch.org/t/how-to-import-caffe2-weights-in-pytorch/117195/1 "2021-04-06T06:46:11Z")

</div>

I have init\_net.pb and predict\_net.pb files of a caffe2 model. I have created the same network in pytorch. Now, I want to copy all the weights from caffe2 to pytorch model. Can someone please guide me how to do that?  
These are the layers with trainable weights in caffe2:  
conv  
spatial\_bn  
conv\_transpose

@ptrblck please help
