我用python(pycaffe)使用caffe。 我正在使用模型动物园的预建的alexnet模型 。
从此页面: https : //github.com/BVLC/caffe/tree/master/models/bvlc_alexnet
每次我使用该模型时,都使用以下代码:
net = caffe.Classifier('deploy.prototxt','bvlc_alexnet.caffemodel', channel_swap=(2,1,0), raw_scale=255, image_dims=(256, 256))咖啡告诉我,文件格式是旧的,它需要升级文件。 这不应该只发生一次?
E0304 20:52:57.356480 12716 upgrade_proto.cpp:609] Attempting to upgrade input file specified using deprecated transformation parameters: /tmp/bvlc_alexnet.caffemodel I0304 20:52:57.356554 12716 upgrade_proto.cpp:612] Successfully upgraded file specified using deprecated data transformation parameters. E0304 20:52:57.356564 12716 upgrade_proto.cpp:614] Note that future Caffe releases will only support transform_param messages for transformation fields. E0304 20:52:57.356580 12716 upgrade_proto.cpp:618] Attempting to upgrade input file specified using deprecated V1LayerParameter: /tmp/bvlc_alexnet.caffemodel I0304 20:52:59.307096 12716 upgrade_proto.cpp:626] Successfully upgraded file specified using deprecated V1LayerParameter
我该如何正确升级文件,以免每次都发生这种情况。
I am using caffe with python(pycaffe). I am using the prebuilt alexnet model from model zoo.
from this page: https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet
Every time I use the model, with this code:
net = caffe.Classifier('deploy.prototxt','bvlc_alexnet.caffemodel', channel_swap=(2,1,0), raw_scale=255, image_dims=(256, 256))caffe tells me the file format is old and it needs to upgrade the file. Shouldn't this happen only once?
E0304 20:52:57.356480 12716 upgrade_proto.cpp:609] Attempting to upgrade input file specified using deprecated transformation parameters: /tmp/bvlc_alexnet.caffemodel I0304 20:52:57.356554 12716 upgrade_proto.cpp:612] Successfully upgraded file specified using deprecated data transformation parameters. E0304 20:52:57.356564 12716 upgrade_proto.cpp:614] Note that future Caffe releases will only support transform_param messages for transformation fields. E0304 20:52:57.356580 12716 upgrade_proto.cpp:618] Attempting to upgrade input file specified using deprecated V1LayerParameter: /tmp/bvlc_alexnet.caffemodel I0304 20:52:59.307096 12716 upgrade_proto.cpp:626] Successfully upgraded file specified using deprecated V1LayerParameter
how can I properly upgrade the file so that this doesn't happen every single time.
最满意答案
加载模型时,caffe会升级prototxt和binary proto,但不会覆盖您正在使用的原始文件。 这就是为什么你不断收到这个消息。
升级非常简单。 在$CAFFE_ROOT/build/tools您将找到两个二进制文件: upgrade_net_proto_binary和upgrade_net_proto_text 。 只需将它们应用到您的deploy.prototxt和bvlc_alexnet.caffemodel并保存结果:
~$ mv deploy.prototxt deploy_old.prototxt ~$ mv bvlc_alexnet.caffemodel bvlc_alexnet_old.caffemodel ~$ $CAFFE_ROOT/build/tools/upgrade_net_proto_text deploy_old.prototx deploy.prototxt ~$ $CAFFE_ROOT/build/tools/upgrade_net_proto_binary bvlc_alexnet_old.caffemodel bvlc_alexnet.caffemodel就是这样!
When you load the model caffe upgrades your prototxt and binary proto, but does not override the original files you are using. This is why you keep getting this message.
Upgrading is very straight forward. In $CAFFE_ROOT/build/tools you'll find two binaries: upgrade_net_proto_binary and upgrade_net_proto_text. Simply apply them to your deploy.prototxt and bvlc_alexnet.caffemodel and save the results:
~$ mv deploy.prototxt deploy_old.prototxt ~$ mv bvlc_alexnet.caffemodel bvlc_alexnet_old.caffemodel ~$ $CAFFE_ROOT/build/tools/upgrade_net_proto_text deploy_old.prototx deploy.prototxt ~$ $CAFFE_ROOT/build/tools/upgrade_net_proto_binary bvlc_alexnet_old.caffemodel bvlc_alexnet.caffemodelAnd that's it!
更多推荐
发布评论