# Convert caffe lstm to pytorch

**URL:** <https://discuss.pytorch.org/t/convert-caffe-lstm-to-pytorch/48869>\
**Category:** nlp\
**Created:** [June 25, 2019, 1:53am UTC](https://discuss.pytorch.org/t/convert-caffe-lstm-to-pytorch/48869 "2019-06-25T01:53:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan95](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ryan95/32/12502_2.png) [@Ryan95](https://discuss.pytorch.org/u/Ryan95)\
**Post date:** [June 25, 2019, 1:53am UTC](https://discuss.pytorch.org/t/convert-caffe-lstm-to-pytorch/48869/1 "2019-06-25T01:53:50Z")

</div>

Hi, I want to convert lstm model from caffe to PyTorch, but the calculation results have a problem. I think I correctly set the parameter information required by PyTorch lstm {weight\_ih\_l0, weight\_hh\_l0, bias\_ih\_l0, bias\_hh\_l0}. because i got same shape between caffe and pytorch  
In caffe, bias\_ih and bias\_hh merged into bias, so I passed the bias to bias\_ih and set bias\_hh to 0.

can someone tell me where’s problems? thank you!
