how to use other users changes on caffe

289 views
Skip to first unread message

mohsen zarrindel

unread,
Sep 13, 2017, 6:10:21 AM9/13/17
to Caffe Users

Hi
I want to use segnet to image segmentation and i find this project:
but my caffe does not support Upsample layer
I copy upsample_layer.cpp and upsample_layer.cu and upsample_layer.hpp to bellow address
  • C:\Users\mohsen\Desktop\Propozal\DeepLearning\InstallCaffe\caffe-windows\caffe-windows\src\caffe\layers\upsample_layer.cpp
  • C:\Users\mohsen\Desktop\Propozal\DeepLearning\InstallCaffe\caffe-windows\caffe-windows\src\caffe\layers\upsample_layer.cu
  • C:\Users\mohsen\Desktop\Propozal\DeepLearning\InstallCaffe\caffe-windows\caffe-windows\include\caffe\layers\upsample_layer.hpp
then I add bellow code to caffe.proto:

message LayerParameter{...optional UpsampleParameter upsample_param = 150;...}
message UpsampleParameter {
  // DEPRECATED. No need to specify upsampling scale factors when
  // exact output shape is given by upsample_h, upsample_w parameters.
  optional uint32 scale = 1 [default = 2];
  // DEPRECATED. No need to specify upsampling scale factors when
  // exact output shape is given by upsample_h, upsample_w parameters.
  optional uint32 scale_h = 2;
  // DEPRECATED. No need to specify upsampling scale factors when
  // exact output shape is given by upsample_h, upsample_w parameters.
  optional uint32 scale_w = 3;
  // DEPRECATED. Specify exact output height using upsample_h. This
  // parameter only works when scale is 2
  optional bool pad_out_h = 4 [default = false];
  // DEPRECATED. Specify exact output width using upsample_w. This
  // parameter only works when scale is 2
  optional bool pad_out_w = 5 [default = false];
  optional uint32 upsample_h = 6;
  optional uint32 upsample_w = 7;
}
and biuld caffe again. but when I run bellow code
C:\Users\mypc\Anaconda3\envs\firstEnvironment\install\bin>caffe train -solver c:\users\mypc\deeplearning\DeepNetsForEO-master\models\solver_isprs_vaihingen_irrg.prototxt
I have Error:
I0913 14:17:35.783287  5428 solver.cpp:87] Creating training net from net file: C:/Users/mohsen/Desktop/Propozal/DeepLearning/InstallCaffe/caffe-windows/implement_propozal/DeepNetsForEO-master/mode
ls/segnet_isprs_vaihingen_irrg.prototxt
[libprotobuf ERROR C:\Users\guillaume\work\caffe-builder\build_v140_x64\packages\protobuf\protobuf_download-prefix\src\protobuf_download\src\google\protobuf\text_format.cc:298] Error parsing text-f
ormat caffe.NetParameter: 747:17: Message type "caffe.LayerParameter" has no field named "Upsample_param".
F0913 14:17:35.783287  5428 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: C:/Users/mohsen/Desktop/Propozal/DeepLearning/InstallCaff
e/caffe-windows/implement_propozal/DeepNetsForEO-master/models/segnet_isprs_vaihingen_irrg.prototxt
*** Check failure stack trace: ***

How can I resolve it?

Przemek D

unread,
Sep 18, 2017, 3:52:47 AM9/18/17
to Caffe Users
Prototxt is case-sensitive. You've added an optional parameter called upsample_param in the caffe.proto, but in your network definition you are referring to Upsample_param. Change that to lowercase and it should work.
Reply all
Reply to author
Forward
0 new messages