# Loading a prebuilt caffe model in pytorch 1.0

**URL:** <https://discuss.pytorch.org/t/loading-a-prebuilt-caffe-model-in-pytorch-1-0/30205>\
**Category:** vision\
**Created:** [November 21, 2018, 3:52pm UTC](https://discuss.pytorch.org/t/loading-a-prebuilt-caffe-model-in-pytorch-1-0/30205 "2018-11-21T15:52:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_Pamparana](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/luca_pamparana/32/14310_2.png) [@Luca\_Pamparana](https://discuss.pytorch.org/u/Luca_Pamparana)\
**Post date:** [November 21, 2018, 3:52pm UTC](https://discuss.pytorch.org/t/loading-a-prebuilt-caffe-model-in-pytorch-1-0/30205/1 "2018-11-21T15:52:10Z")

</div>

I heard that there is some good integration of caffe and pytorch with the 1.0 release. I am trying to use the modified GoogleLeNet model that has been trained on the Compcars dataset. The pretrained caffe model and the weights are available here: [https://gist.github.com/bogger/b90eb88e31cd745525ae](https://gist.github.com/bogger/b90eb88e31cd745525ae)

So, basically what is available is the `prototxt` model definition file and the `caffemodel` weights file. So, I was looking into the documentation for pytorch 1.0 and came across the following tutorial: [https://pytorch.org/tutorials/advanced/super\_resolution\_with\_caffe2.html](https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html)

I also saw some converters online for converting the caffemodel file to PTH. I was wondering if there is something built into pytorch 1.0 to sort of somehow take the caffe model definition and weight files and generate the model from this?

---

<div class="post-metadata">

**Author:** ![albanD](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/32/215_2.png) [@albanD](https://discuss.pytorch.org/u/albanD)\
**Post date:** [November 21, 2018, 4:09pm UTC](https://discuss.pytorch.org/t/loading-a-prebuilt-caffe-model-in-pytorch-1-0/30205/2 "2018-11-21T16:09:31Z")

</div>

Hi,

You can always use ONNX to do caffe2 -\> onnx -\> pytorch. But people usually do the opposite 😃 and there is no special integration to run caffe2 models in pytorch.

---

<div class="post-metadata">

**Author:** ![Luca\_Pamparana](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/luca_pamparana/32/14310_2.png) [@Luca\_Pamparana](https://discuss.pytorch.org/u/Luca_Pamparana)\
**Post date:** [November 21, 2018, 8:25pm UTC](https://discuss.pytorch.org/t/loading-a-prebuilt-caffe-model-in-pytorch-1-0/30205/3 "2018-11-21T20:25:08Z")

</div>

Thanks for that. Unfortunately, this model seems to be using an older version of caffe. I will investigate on what I can do. My issue is that I need to do some transfer learning on this model and would like to change it later as well. So hoping to find a convenient way to do this.
