默认:Python已经安装好
1.从网上下载VGG模型
http://www.robots.ox.ac.uk/~vgg/research/very_deep/
- 16-layer model: information page in the Caffe Zoo,
http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_16_layers.caffemodel
weights (528 MB)
,
layer configuration
- 19-layer model: information page in the Caffe Zoo,
http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel
weights (548 MB)
,
layer configuration
2. Caffe模型转换成MxNet模型的工具
https://github.com/dmlc/mxnet/tree/master/tools/caffe_converter
将该目录下的所有文件拷贝到一个目录下
3. 命令行 进行模型转换
E:\convertmodel>python convert_model.py VGG_ILSVRC_16_layers_deploy.prototxt VGG_ILSVRC_16_layers.caffemodel VGG16
输出信息如下:
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0711 10:32:07.545542 10076 common.cpp:36] System entropy source not available, using fallback algorithm to generate seed instead.
I0711 10:32:07.551548 10076 upgrade_proto.cpp:52] Attempting to upgrade input file specified using deprecated V1LayerParameter: VGG_ILSVRC_16_layers_deploy.prototxt
I0711 10:32:07.553550 10076 upgrade_proto.cpp:60] Successfully upgraded file specified using deprecated V1LayerParameter
I0711 10:32:07.556553 10076 upgrade_proto.cpp:66] Attempting to upgrade input file specified using deprecated input fields: VGG_ILSVRC_16_layers_deploy.prototxt
I0711 10:32:07.558554 10076 upgrade_proto.cpp:69] Successfully upgraded file specified using deprecated input fields.
W0711 10:32:07.561558 10076 upgrade_proto.cpp:71] Note that future Caffe releases will only support input layers and not input fields.
I0711 10:32:07.564560 10076 net.cpp:49] Initializing net from parameters:
name: "VGG_ILSVRC_16_layers"
state {
phase: TEST
}
......
converting layer conv4_3, wmat shape = (512L, 512L, 3L, 3L), bias shape = (512L,)
converting layer conv5_1, wmat shape = (512L, 512L, 3L, 3L), bias shape = (512L,)
converting layer conv5_2, wmat shape = (512L, 512L, 3L, 3L), bias shape = (512L,)
converting layer conv5_3, wmat shape = (512L, 512L, 3L, 3L), bias shape = (512L,)
converting layer fc6, wmat shape = (4096L, 25088L), bias shape = (4096L,)
converting layer fc7, wmat shape = (4096L, 4096L), bias shape = (4096L,)
converting layer fc8, wmat shape = (1000L, 4096L), bias shape = (1000L,)
4.最后在该目录下生成两个文件: