3

私はpython(pycaffe)でカフェを使用しています。model Zoo のビルド済み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))

caffe は、ファイル形式が古いため、ファイルをアップグレードする必要があることを通知します。これは一度だけでいいのではないですか?

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

これが毎回発生しないように、ファイルを適切にアップグレードするにはどうすればよいですか。

4

2 に答える 2

5

モデルをロードすると、caffe は prototxt とバイナリ proto をアップグレードしますが、使用している元のファイルを上書きしません。これが、このメッセージを受け取り続ける理由です。

アップグレードは非常に簡単です。には、 と$CAFFE_ROOT/build/toolsの 2 つのバイナリがupgrade_net_proto_binaryありupgrade_net_proto_textます。deploy.prototxtそれらをandに適用し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

以上です!

于 2016-03-13T06:34:39.393 に答える
1

助けてくれてありがとうシャイ。
ただし、Windows upgrade_net_proto_binaryを使用していて、 upgrade_net_proto_text.exe ファイルがpath-to-caffe-master/caffe/build/tools/Release.

これがWindowsユーザーに役立つことを願っています

于 2017-10-17T05:16:50.077 に答える