> For the complete documentation index, see [llms.txt](https://sisyphus.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sisyphus.gitbook.io/project/deep-learning-basics/converting-between-frameworks/caffe-to-tensorflow.md).

# Caffe to TensorFlow

* TensorFlowTransformer will build a Kaffe graph first, from the caffe prototxt.
  * It has its own node class and graph class
  * Node: layer type, specification, parameters, parent, children etc.
  * Graph: how to add node / build graph in topological order
* Converting the parameters of all graph nodes into correct format ((c\_o, c\_i, h, w) -> (h, w, c\_i, c\_o))
  * In Numpy format
* Write generated [Kaffe.tensorflow.Network](http://Kaffe.tensorflow.Network) class code
* When doing the inference,  [Kaffe.tensorflow.Network](http://Kaffe.tensorflow.Network) will converting the Kaffe nodes into tensorflow operators.
* Problem:
  * Needs updated version caffe model
  * Needs Kaffe library
  * Numpy format parameters
  * Couldn’t deploy
  * Tensorflow version out-dated
* Modified version:
  * Automatic caffe model updating script
  * Update tensorflow operators from 0.8.0 -> 1.2.1
  * Add saving checkpoint and frozen graph options, ez deployment&#x20;

Reference:

{% embed url="<https://github.com/ethereon/caffe-tensorflow>" %}
