Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consult whether this codes can be complied and run on Linux #13

Open
xhappy opened this issue Nov 28, 2017 · 12 comments
Open

Consult whether this codes can be complied and run on Linux #13

xhappy opened this issue Nov 28, 2017 · 12 comments

Comments

@xhappy
Copy link

xhappy commented Nov 28, 2017

Hello ZhaoFan,

Thanks for your great work.

I would like to consult whether your codes can be compiled and run on Caffe for Linux without any modifications except updating configurations. I suspect that it will be "NO" since I got many compiling error under Linux....Could you please help to point it? I only need answer "Yes" Or "NO", a simple reply. Thanks in advance.

@ZhaofanQiu
Copy link
Owner

Yes. I have tested this code on linux platform.
But I am not very familiar with caffe on linux. Maybe in some specific case, it will give some errors. I can try to help you after you show me the error messages.
Best.

@xhappy
Copy link
Author

xhappy commented Nov 29, 2017

Hi,
Thanks for your quickly replies.

Well, I download Caffe for linux from the link: https://github.com/BVLC/caffe, put your codes to directory examples, and modified the Makefile (added the header file to INCLUDE_DIRS variables), also modified your codes (header on *.cpp file only), and got the errors as below:

CXX examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp: In instantiation of ‘void caffe::BNLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]’:
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:351:2: required from here
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:16:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
frozen_ = this->layer_param_.bn_param().frozen();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:17:16: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_momentum_ = this->layer_param_.bn_param().momentum();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:18:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_eps_ = this->layer_param_.bn_param().eps();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:32:60: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > slope_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:37:59: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > bias_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp: In instantiation of ‘void caffe::BNLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = double]’:
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:351:2: required from here
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:16:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
frozen_ = this->layer_param_.bn_param().frozen();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:17:16: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_momentum_ = this->layer_param_.bn_param().momentum();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:18:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_eps_ = this->layer_param_.bn_param().eps();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:32:60: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > slope_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:37:59: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > bias_filler(GetFiller(
^
Makefile:586: recipe for target '.build_release/examples/pseudo-3d/caffe_add_layers/src/bn_layer.o' failed
make: *** [.build_release/examples/pseudo-3d/caffe_add_layers/src/bn_layer.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:15:0:
/home/xiaotf/video/caffe/examples/pseudo-3d/caffe_add_layers/include/pooling3d_layer.hpp:26:41: fatal error: caffe/layers/video_common.hpp: No such file or directory
compilation terminated.
Makefile:586: recipe for target '.build_release/examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.o' failed
make: *** [.build_release/examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.o] Error 1
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

Could you please help to fix it? Thanks in advance.

@jetyingjia
Copy link

https://github.com/facebook/C3D/tree/master/C3D-v1.1
You can use this project. It is good.

@xhappy
Copy link
Author

xhappy commented Nov 29, 2017

@jetyingjia
Thanks for your reply. But I also encountered compiling errors when using the C3D project link as you provided. The errors are as below:

CXX examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp
CXX examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp: In instantiation of ‘void caffe::BNLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]’:
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:351:2: required from here
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:16:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
frozen_ = this->layer_param_.bn_param().frozen();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:17:16: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_momentum_ = this->layer_param_.bn_param().momentum();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:18:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_eps_ = this->layer_param_.bn_param().eps();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:32:60: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > slope_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:37:59: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > bias_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp: In instantiation of ‘void caffe::BNLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = double]’:
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:351:2: required from here
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:16:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
frozen_ = this->layer_param_.bn_param().frozen();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:17:16: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_momentum_ = this->layer_param_.bn_param().momentum();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:18:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_eps_ = this->layer_param_.bn_param().eps();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:32:60: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > slope_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:37:59: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > bias_filler(GetFiller(
^
Makefile:586: recipe for target '.build_release/examples/pseudo-3d/caffe_add_layers/src/bn_layer.o' failed
make: *** [.build_release/examples/pseudo-3d/caffe_add_layers/src/bn_layer.o] Error 1
make: *** Waiting for unfinished jobs....
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp: In member function ‘virtual void caffe::Pooling3DLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&)’:
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:26:17: error: ‘class caffe::Pooling3DParameter’ has no member named ‘global_pooling’
if (pool_param.global_pooling()) {
^
In file included from ./include/caffe/common.hpp:6:0,
from ./include/caffe/blob.hpp:8,
from /home/xiaotf/video/C3D-v1.1/examples/pseudo-3d/caffe_add_layers/include/pooling3d_layer.hpp:20,
from examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:15:
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:28:15: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_h’
pool_param.has_kernel_h() || pool_param.has_kernel_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:28:44: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_w’
pool_param.has_kernel_h() || pool_param.has_kernel_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:33:17: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_h’
!(pool_param.has_kernel_h() && pool_param.has_kernel_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:33:46: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_w’
!(pool_param.has_kernel_h() && pool_param.has_kernel_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:36:16: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_h’
(pool_param.has_kernel_h() && pool_param.has_kernel_w())) && pool_param.has_kernel_l())
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:36:45: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_w’
(pool_param.has_kernel_h() && pool_param.has_kernel_w())) && pool_param.has_kernel_l())
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:36:76: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_kernel_l’
(pool_param.has_kernel_h() && pool_param.has_kernel_w())) && pool_param.has_kernel_l())
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:39:45: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_pad_h’
CHECK((!pool_param.has_pad() && pool_param.has_pad_h()
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:40:17: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_pad_w’
&& pool_param.has_pad_w())
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:41:19: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_pad_h’
|| (!pool_param.has_pad_h() && !pool_param.has_pad_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:41:46: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_pad_w’
|| (!pool_param.has_pad_h() && !pool_param.has_pad_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:43:48: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_stride_h’
CHECK((!pool_param.has_stride() && pool_param.has_stride_h()
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:44:17: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_stride_w’
&& pool_param.has_stride_w())
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:45:19: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_stride_h’
|| (!pool_param.has_stride_h() && !pool_param.has_stride_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:45:49: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_stride_w’
|| (!pool_param.has_stride_h() && !pool_param.has_stride_w()))
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:47:31: error: ‘class caffe::Pooling3DParameter’ has no member named ‘global_pooling’
global_pooling_ = pool_param.global_pooling();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:54:27: error: ‘class caffe::Pooling3DParameter’ has no member named ‘kernel_l’
kernel_l_ = pool_param.kernel_l();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:59:28: error: ‘class caffe::Pooling3DParameter’ has no member named ‘kernel_h’
kernel_h_ = pool_param.kernel_h();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:60:28: error: ‘class caffe::Pooling3DParameter’ has no member named ‘kernel_w’
kernel_w_ = pool_param.kernel_w();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:66:19: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_pad_h’
if (!pool_param.has_pad_h()) {
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:70:24: error: ‘class caffe::Pooling3DParameter’ has no member named ‘pad_h’
pad_h_ = pool_param.pad_h();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:71:24: error: ‘class caffe::Pooling3DParameter’ has no member named ‘pad_w’
pad_w_ = pool_param.pad_w();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:73:23: error: ‘class caffe::Pooling3DParameter’ has no member named ‘pad_l’
pad_l_ = pool_param.pad_l();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:74:19: error: ‘class caffe::Pooling3DParameter’ has no member named ‘has_stride_h’
if (!pool_param.has_stride_h()) {
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:78:27: error: ‘class caffe::Pooling3DParameter’ has no member named ‘stride_h’
stride_h_ = pool_param.stride_h();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:79:27: error: ‘class caffe::Pooling3DParameter’ has no member named ‘stride_w’
stride_w_ = pool_param.stride_w();
^
examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.cpp:81:26: error: ‘class caffe::Pooling3DParameter’ has no member named ‘stride_l’
stride_l_ = pool_param.stride_l();
^
Makefile:586: recipe for target '.build_release/examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.o' failed
make: *** [.build_release/examples/pseudo-3d/caffe_add_layers/src/pooling3d_layer.o] Error 1

@xhappy
Copy link
Author

xhappy commented Nov 29, 2017

I found that the caffe.proto file on this project contains following structure:

message BNParameter {
optional FillerParameter slope_filler = 1;
optional FillerParameter bias_filler = 2;
optional float momentum = 3 [default = 0.9];
optional float eps = 4 [default = 1e-5];
// If true, will use the moving average mean and std for training and test.
// Will override the lr_param and freeze all the parameters.
// Make sure to initialize the layer properly with pretrained parameters.
optional bool frozen = 5 [default = false];
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 6 [default = DEFAULT];
}

But why it don't contain bn_param parmeter? How to add this parameter to this file caffe.proto ?

@xhappy
Copy link
Author

xhappy commented Nov 29, 2017

Now, only remained following errors:
CXX examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp: In instantiation of ‘void caffe::BNLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]’:
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:351:2: required from here
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:16:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
frozen_ = this->layer_param_.bn_param().frozen();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:17:16: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_momentum_ = this->layer_param_.bn_param().momentum();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:18:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_eps_ = this->layer_param_.bn_param().eps();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:32:60: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > slope_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:37:59: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > bias_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp: In instantiation of ‘void caffe::BNLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = double]’:
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:351:2: required from here
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:16:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
frozen_ = this->layer_param_.bn_param().frozen();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:17:16: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_momentum_ = this->layer_param_.bn_param().momentum();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:18:11: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
bn_eps_ = this->layer_param_.bn_param().eps();
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:32:60: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > slope_filler(GetFiller(
^
examples/pseudo-3d/caffe_add_layers/src/bn_layer.cpp:37:59: error: ‘class caffe::LayerParameter’ has no member named ‘bn_param’
shared_ptr<Filler > bias_filler(GetFiller(
^
Makefile:590: recipe for target '.build_release/examples/pseudo-3d/caffe_add_layers/src/bn_layer.o' failed
make: *** [.build_release/examples/pseudo-3d/caffe_add_layers/src/bn_layer.o] Error 1

@ZhaofanQiu
Copy link
Owner

Hi,
For the bn_param, you need to add this parameter to your LayerParameter in "caffe.proto". For example,
optional BNParameter bn_param = 155;
in "message LayerParameter", the "155" depends on your layer ID.
Best.

@xhappy
Copy link
Author

xhappy commented Nov 29, 2017

Hi ZhoFan,
Have added following codes to caffe.proto, but compiling errors as above......

message LayerParameter {
optional BNParameter bn_param = 155;
}

@ZhaofanQiu
Copy link
Owner

Hi, you add this line to the existed LayerParameter or create a new LayerParamter?
You need to find the LayerParameter in you "caffe.proto". There are some existed layer parameter definitions in LayerParameter, and then you can add the paramters for new layers to LayerParameter.
Best.

@xhappy
Copy link
Author

xhappy commented Nov 29, 2017

I add above total structure to caffe.proto which is downloaded from your project here. I don't find any caffe.proto files except the caffe.proto downloaded from your project...., And In your caffe.proto files, there are not any structures named LayerParameter, that's why I added the total structure(only contain bn_param) to the file.

@zzy123abc
Copy link

zzy123abc commented Feb 1, 2018

// NOTE
// Update the next available ID when you add a new LayerParameter field.
//
// LayerParameter next available layer-specific ID: 147 (last added: recurrent_param)
message LayerParameter {
optional string name = 1; // the layer name
optional string type = 2; // the layer type
repeated string bottom = 3; // the name of each bottom blob
repeated string top = 4; // the name of each top blob

// The train / test phase for computation.
optional Phase phase = 10;

// The amount of weight to assign each top blob in the objective.
// Each layer assigns a default value, usually of either 0 or 1,
// to each top blob.
repeated float loss_weight = 5;

// Specifies training parameters (multipliers on global learning constants,
// and the name and other settings used for weight sharing).
repeated ParamSpec param = 6;

// The blobs containing the numeric parameters of the layer.
repeated BlobProto blobs = 7;

// Specifies whether to backpropagate to each bottom. If unspecified,
// Caffe will automatically infer whether each input needs backpropagation
// to compute parameter gradients. If set to true for some inputs,
// backpropagation to those inputs is forced; if set false for some inputs,
// backpropagation to those inputs is skipped.
//
// The size must be either 0 or equal to the number of bottoms.
repeated bool propagate_down = 11;

// Rules controlling whether and when a layer is included in the network,
// based on the current NetState. You may specify a non-zero number of rules
// to include OR exclude, but not both. If no include or exclude rules are
// specified, the layer is always included. If the current NetState meets
// ANY (i.e., one or more) of the specified rules, the layer is
// included/excluded.
repeated NetStateRule include = 8;
repeated NetStateRule exclude = 9;

// Parameters for data pre-processing.
optional TransformationParameter transform_param = 100;

// Parameters shared by loss layers.
optional LossParameter loss_param = 101;

// Layer type-specific parameters.
//
// Note: certain layers may have more than one computational engine
// for their implementation. These layers include an Engine type and
// engine parameter for selecting the implementation.
// The default for the engine is set by the ENGINE switch at compile-time.
optional AccuracyParameter accuracy_param = 102;
optional ArgMaxParameter argmax_param = 103;
optional BatchNormParameter batch_norm_param = 139;
optional BNParameter bn_param = 155;
optional BiasParameter bias_param = 141;
optional ConcatParameter concat_param = 104;
optional ContrastiveLossParameter contrastive_loss_param = 105;
optional ConvolutionParameter convolution_param = 106;
optional CropParameter crop_param = 144;
optional DataParameter data_param = 107;
optional DropoutParameter dropout_param = 108;
optional DummyDataParameter dummy_data_param = 109;
optional EltwiseParameter eltwise_param = 110;
optional ELUParameter elu_param = 140;
optional EmbedParameter embed_param = 137;
optional ExpParameter exp_param = 111;
optional FlattenParameter flatten_param = 135;
optional HDF5DataParameter hdf5_data_param = 112;
optional HDF5OutputParameter hdf5_output_param = 113;
optional HingeLossParameter hinge_loss_param = 114;
optional ImageDataParameter image_data_param = 115;
optional InfogainLossParameter infogain_loss_param = 116;
optional InnerProductParameter inner_product_param = 117;
optional InputParameter input_param = 143;
optional LogParameter log_param = 134;
optional LRNParameter lrn_param = 118;
optional MemoryDataParameter memory_data_param = 119;
optional MVNParameter mvn_param = 120;
optional ParameterParameter parameter_param = 145;
optional PoolingParameter pooling_param = 121;
optional Pooling3DParameter pooling3d_param = 156;
optional PowerParameter power_param = 122;
optional PReLUParameter prelu_param = 131;
optional PythonParameter python_param = 130;
optional RecurrentParameter recurrent_param = 146;
optional ReductionParameter reduction_param = 136;
optional ReLUParameter relu_param = 123;
optional ReshapeParameter reshape_param = 133;
optional ScaleParameter scale_param = 142;
optional SigmoidParameter sigmoid_param = 124;
optional SoftmaxParameter softmax_param = 125;
optional SPPParameter spp_param = 132;
optional SliceParameter slice_param = 126;
optional TanHParameter tanh_param = 127;
optional ThresholdParameter threshold_param = 128;
optional TileParameter tile_param = 138;
optional WindowDataParameter window_data_param = 129;
}

message Pooling3DParameter {
enum PoolMethod {
MAX = 0;
AVE = 1;
STOCHASTIC = 2;
}
optional PoolMethod pool = 1 [default = MAX]; // The pooling method
// Pad, kernel size, and stride are all given as a single value for equal
// dimensions in height and width or as Y, X pairs.
optional uint32 pad = 2 [default = 0]; // The padding size (equal in Y, X)
optional uint32 pad_h = 5 [default = 0]; // The padding height
optional uint32 pad_w = 6 [default = 0]; // The padding width
optional uint32 pad_l = 7 [default = 0]; // The padding length
optional uint32 kernel_size = 3; // The kernel size (square)
optional uint32 kernel_h = 8; // The kernel height
optional uint32 kernel_w = 9; // The kernel width
optional uint32 kernel_l = 10; // The kernel length
optional uint32 stride = 4 [default = 1]; // The stride (equal in Y, X)
optional uint32 stride_h = 11; // The stride height
optional uint32 stride_w = 12; // The stride width
optional uint32 stride_l = 13 [default = 1]; // The stride length
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 14 [default = DEFAULT];
// If global_pooling then it will pool over the size of the bottom by doing
// kernel_h = bottom->height and kernel_w = bottom->width
optional bool global_pooling = 15 [default = false];
}

message BNParameter {
optional FillerParameter slope_filler = 1;
optional FillerParameter bias_filler = 2;
optional float momentum = 3 [default = 0.9];
optional float eps = 4 [default = 1e-5];
// If true, will use the moving average mean and std for training and test.
// Will override the lr_param and freeze all the parameters.
// Make sure to initialize the layer properly with pretrained parameters.
optional bool frozen = 5 [default = false];
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 6 [default = DEFAULT];
}

Your own caffe include caffe.proto,you just need to modify the first one LayerParameter:
optional BNParameter bn_param = 155;
optional Pooling3DParameter pooling3d_param = 156;
and add the last two layers Pooling3DParameter ,BNParameter .

@gemfield
Copy link

gemfield commented Apr 8, 2018

@xhappy P3D can be compiled on Linux platform. Check the step instructions here: https://zhuanlan.zhihu.com/p/35359709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants