The realization of shufflenet in Caffe frame

Source: Internet
Author: User
Tags stack trace

This article is in the implementation of GitHub on the user Farmingyard posted accelerated version shufflenet. The following are the included files:

As a small white in the depth of learning, the beginning is really confused, in the previous Caffe framework used, but simply will put someone else's deploy.prototxt,train.prototxt, Solver.prototxt to use, make a data set run, a little bit of change, for example, some network GitHub only to a deploy.prototxt file, or like this also give. cpp. cu. hpp file readme.md is this:


After writing out the other two files, a direct cruise will have the following problems:

I1017 22:40:08.742588 8634 solver.cpp:87] Creating training net from net file:/home/t702/zrx/shufflenet/train_val.proto TXT [libprotobuf error google/protobuf/text_format.cc:245] Error parsing Text-format Caffe. Netparameter:347:25:message type "Caffe.
Layerparameter "has no field named" Shuffle_channel_param ". F1017 22:40:08.742987 8634 upgrade_proto.cpp:88] Check failed:readprotofromtextfile (param_file, param) failed to parse N   Etparameter File:/home/t702/zrx/shufflenet/train_val.prototxt * * Check failure Stack Trace: * * * 0X7F3407747DAA
    (unknown) @ 0x7f3407747ce4 (unknown) @ 0x7f34077476e6 (unknown) @ 0x7f340774a687 (unknown) @ 0x7f3407e7608e Caffe::readnetparamsfromtextfileordie () @ 0X7F3407E47DCC Caffe::solver<>::inittrain
    Net () @ 0x7f3407e48c83 caffe::solver<>::init () @ 0x7f3407e48f5f caffe::solver<>::solver () @ 0x7f3407ea5e91 caffe::creator_sgdsolver<> () @ 0x40ee6e caffe::solverregistry<>::createsolver () @ 0X407EFD train () @ 0x40590c Main @ 0x7f3406753f45 (unknown) @ 0x40617b (unknown) @ (nil) (unknown)

The following is mainly to solve this problem. 1. Use of related documents

If only one deploy.prototxt file is given, the other two. Prototxt configuration files are required by our users according to their own situation and given the deploy.prototxt of their own written, asked a given the Caffe framework model of the original author, the Great God said this is the Caffe framework of the most basic Things up. T T

And then give out like this

Shuffle_channel_layer.cpp 
shuffle_channel_layer.cu 
shuffle_channel_layer.hpp

Three files, basically are the network structure of their own definition of layer, is not the Caffe framework itself, we need to add to the Caffe framework.
Take Shufflenet as an example, the specific use of the steps is to:

Shuffle_channel_layer.cpp 

Into the caffe/src/caffe/layers path, and

Shuffle_channel_layer.hpp

Put it in the caffe/include/caffe/layers path. Then, like the declaration of a function, we need to find the message layerparameter{in the Caffe/src/caffe/proto/caffe.proto file ...} This statement
and add a statement to it:

Message Layerparameter {
...
Optional Shufflechannelparameter Shuffle_channel_param = 164;
...
}
...
Message shufflechannelparameter {
  optional uint32 group = 1[default = 1];//The number of group
}

After you complete the above steps, you will need to recompile in Caffe, and it is also simple to open the command line directly under the Caffe folder:

Make All-j4

You can use Type:shufflechannel1 's layer when running Caffe training. 2. Start Training

And then is to prepare the dataset, according to Deploy.prototxt file prepared Train.prototxt and solver.prototxt can start training. Ps:

GitHub There is also a version of the shufflenet in the direct use of the following error:

I1017 22:42:00.554802 8701 solver.cpp:87] Creating training net from net file:/home/t702/zrx/shufflenet/train.prototxt [ LIBPROTOBUF Error google/protobuf/text_format.cc:245] Error parsing Text-format Caffe. Netparameter:145:17:message type "Caffe.
Layerparameter "has no field named" Permute_param ". F1017 22:42:00.555064 8701 upgrade_proto.cpp:88] Check failed:readprotofromtextfile (param_file, param) failed to parse N Etparameter File:/home/t702/zrx/shufflenet/train.prototxt * * Check failure Stack Trace: * * * 0X7F4EF019CDAA (U     Nknown @ 0x7f4ef019cce4 (unknown) @ 0x7f4ef019c6e6 (unknown) @ 0x7f4ef019f687 (unknown) @ 0x7f4ef08cb08e Caffe::readnetparamsfromtextfileordie () @ 0X7F4EF089CDCC caffe::solver<>::inittrainnet (     @ 0x7f4ef089dc83 Caffe::solver<>::init () @ 0x7f4ef089df5f caffe::solver<>::solver () @ 0x7f4ef08fae91 caffe::creator_sgdsolver<> () @ 0x40ee6e Caffe::Solverregistry<>::createsolver () @ 0X407EFD train () @ 0x40590c main @ 0x7f4eef 1a8f45 (unknown) @ 0x40617b (unknown) @ (nil) (unknown)

The specific workaround is ibid..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.