我怎么能升级我的咖啡模型,所以每次使用它都不会'升级'(how can i upgrade my caffe model so it doesn't 'upgr

编程入门 行业动态 更新时间:2024-10-25 02:30:21
我怎么能升级我的咖啡模型,所以每次使用它都不会'升级'(how can i upgrade my caffe model so it doesn't 'upgrade' every time I use it)

我用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.caffemodel

And that's it!

更多推荐

本文发布于:2023-04-28 00:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329653.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模型   咖啡   使用它   我怎么能   model

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!