Convert a train_val.prototxt into a deploy.prototxt

5,483 views
Skip to first unread message

Luke Yeager

unread,
Oct 8, 2014, 8:30:46 PM10/8/14
to caffe...@googlegroups.com
Is there a tool for converting a network definition (e.g. train_val.prototxt) into a deployment file (e.g. deploy.prototxt)?

They're nearly identical, with the first and last layers altered slightly and some weight information removed, which makes me think it might be possible to write only the network definition and have a tool extract the information necessary to make the deploy file.

Is everyone writing both of those files themselves, or is there some tool I'm not seeing for converting one to the other?

Luke Yeager

unread,
Oct 8, 2014, 8:47:27 PM10/8/14
to caffe...@googlegroups.com
Also, why can't I pass the mean_file in through deploy.prototxt? I can specify it in the network definition - why not for deployment?

Evan Shelhamer

unread,
Oct 8, 2014, 9:00:38 PM10/8/14
to Luke Yeager, caffe...@googlegroups.com
The `input` fields cause a few headaches like

(1) They are not a proper layer so they cannot be included in all-in-one nets by stage or other NetFilter rules
(2) They are nothing but bare blobs so input preprocessing cannot be configured or done automatically
(3) As a result of (2), the Python and MATLAB interfaces duplicate a lot of code and lead to brittle transitions between train / val / data layers and the `input` fields for deployment.

so there's a plan to do away with them. I'll post an issue with the fully story when I can, but the core idea is to replace these fields with `MemoryDataLayer` for deployment, make the tools understand stages so we can mark the layer as the "deploy" input, and then re-define all the reference deploy models and finally deprecate the pycaffe and matcaffe preprocessing code.

Evan Shelhamer

On Wed, Oct 8, 2014 at 5:47 PM, Luke Yeager <luke....@gmail.com> wrote:
Also, why can't I pass the mean_file in through deploy.prototxt? I can specify it in the network definition - why not for deployment?

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/2bc3d1f5-17c1-4d21-8871-1e8f60d3a42f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Luke Yeager

unread,
Oct 8, 2014, 9:04:57 PM10/8/14
to caffe...@googlegroups.com
Thanks for the reply, Evan. That sounds like a good idea.

In answer to my first question, are you saying that there will be a way to convert programmatically to a deploy.prototxt with the future improvements? Or is there still some data in there that can't be inferred?

Evan Shelhamer

unread,
Oct 8, 2014, 9:10:32 PM10/8/14
to Luke Yeager, caffe...@googlegroups.com
The deploy.prototxt will go away completely -- just like train and val were merged into train_val.prototxt there will be one net definition to rule them all that includes the layers and rules for making the train / val / deploy / whatever variations of the net.

There could potentially be a tool to do the conversion when this feature is introduced. Otherwise you'll just have to edit your prototxt.

Evan Shelhamer

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.

Luke Yeager

unread,
Oct 8, 2014, 9:11:44 PM10/8/14
to caffe...@googlegroups.com
Oh, got it. Cool.

Xiao Yang

unread,
Feb 25, 2015, 10:22:22 AM2/25/15
to caffe...@googlegroups.com, luke....@gmail.com, shel...@eecs.berkeley.edu
Hi Shelhamer,

Any progress about this issue? The deploy.prototxt will go away completely

Best,
Xiao

在 2014年10月8日星期三 UTC-4下午9:10:32,Evan Shelhamer写道:
Reply all
Reply to author
Forward
0 new messages