The tool will help you convert trained models from Caffe to CNTK.
Convert trained models: giving a model script and its weights file, export to CNTK model.
-
Protobuf
Using
pip install protobuf
-
Caffe runtime support (Optional)
While loading Caffe models, Model2CNTK will first try to find Caffe packages in you Python dirs. If failing, system will turn to use protobuf to load the models (maybe long as a few mins). A reference to get Caffe python support:
-
You may need to compile caffe_pb2.py with following steps:
a. download and install
protoc
in official websiteb. protoc -I=$Caffe_DIR --python_out=$DST_DIR $Caffe_DIR/proto/caffe.proto
c. copy caffe_pb2.py to adapter/bvlccaffe
CaffeConverter.from_model(global_conf_path)
Usage example: see here
About global conf file: see guideline in here and template in here
Convolution, Dense/Linear, ReLU, Max/Average Pooling, Softmax, Batch Normalization, LRN, Splice, Plus
Model version: we only support inputs with definition of Input layer. To adapt it, please first upgrade your model and prototxt in Caffe tools with commands:
upgrade_net_proto_text/binary.sh
Please find an example of converter usage in here