You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This converter has been adapted from code in Marc Bolaños fork of
Caffe. See acks for code provenance.
This is intended to serve as a conversion module for Caffe models to Keras
models. It only works
with Ye Olde Caffe Classic™ (which isn't really
a thing, but which probably should be a thing to prevent confusion with
the Caffe 2).
Please be aware that this module is not regularly maintained. Thus, some layers
or parameter definitions introduced in newer versions of either Keras or Caffe
might not be compatible with the converter. Pull requests welcome!
Conversion
In order to convert a model you just need the .caffemodel weights and the
.prototxt deploy file. You will need to include the input image dimensions as
a header to the .prototxt network structure, preferably as an Input layer:
Given the differences between Caffe and Keras when applying the max pooling
operation, in some occasions the max pooling layers must include a pad: 1
value even if they did not include them in their original .prototxt.
The module caffe2keras can be used as a command line interface for converting
any model the following way: