torrvision / crfasrnn

This repository contains the source code for the semantic image segmentation method described in the ICCV 2015 paper: Conditional Random Fields as Recurrent Neural Networks. http://crfasrnn.torr.vision/
Other
1.34k stars 462 forks source link

Message type "caffe.LayerParameter" has no field named "multi_stage_meanfield_param" #100

Open jiaozizhao opened 7 years ago

jiaozizhao commented 7 years ago

Hi, when I compile the caffe, there is a warning for the function 'multi_stage_meanfield.cpp' as below:

"src/caffe/layers/multi_stage_meanfield.cpp: In instantiation of ‘void caffe::MultiStageMeanfieldLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]’: src/caffe/layers/multi_stage_meanfield.cpp:258:1: required from here src/caffe/layers/multi_stagemeanfield.cpp:72:83: warning: format ‘%lf’ expects argument of type ‘double’, but argument 3 has type ‘float’ [-Wformat=] fscanf(pFile, "%lf", &this->blobs[0]->mutable_cpudata()[i * channels + i]); ^ src/caffe/layers/multi_stagemeanfield.cpp:79:83: warning: format ‘%lf’ expects argument of type ‘double’, but argument 3 has type ‘float’ [-Wformat=] fscanf(pFile, "%lf", &this->blobs[1]->mutable_cpudata()[i * channels + i]); ^ src/caffe/layers/multi_stage_meanfield.cpp: In member function ‘void caffe::MultiStageMeanfieldLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]’: src/caffe/layers/multi_stage_meanfield.cpp:72:7: warning: ignoring return value of ‘int fscanf(FILE, const char, ...)’, declared with attribute warn_unusedresult [-Wunused-result] fscanf(pFile, "%lf", &this->blobs[0]->mutable_cpudata()[i * channels + i]); ^ src/caffe/layers/multi_stage_meanfield.cpp:79:7: warning: ignoring return value of ‘int fscanf(FILE, const char, ...)’, declared with attribute warn_unusedresult [-Wunused-result] fscanf(pFile, "%lf", &this->blobs[1]->mutable_cpudata()[i * channels + i]); ^ src/caffe/layers/multi_stage_meanfield.cpp: In member function ‘void caffe::MultiStageMeanfieldLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = double]’: src/caffe/layers/multi_stage_meanfield.cpp:72:7: warning: ignoring return value of ‘int fscanf(FILE, const char, ...)’, declared with attribute warn_unusedresult [-Wunused-result] fscanf(pFile, "%lf", &this->blobs[0]->mutable_cpudata()[i * channels + i]); ^ src/caffe/layers/multi_stage_meanfield.cpp:79:7: warning: ignoring return value of ‘int fscanf(FILE, const char, ...)’, declared with attribute warn_unusedresult [-Wunused-result] fscanf(pFile, "%lf", &this->blobs[1]->mutable_cpudata()[i * channels + i]);" ^

And when I run the demo 'crfasrnn_demo.py', there is an error like below:

Input file is " input.jpg Output file is " output.png GPU_DEVICE is " 0 WARNING: Logging before InitGoogleLogging() is written to STDERR W0221 16:34:13.797194 11631 _caffe.cpp:122] DEPRECATION WARNING - deprecated use of Python interface W0221 16:34:13.797235 11631 _caffe.cpp:123] Use this instead (with the named "weights" parameter): W0221 16:34:13.797240 11631 _caffe.cpp:125] Net('TVG_CRFRNN_new_deploy.prototxt', 1, weights='TVG_CRFRNN_COCO_VOC.caffemodel') [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 619:31: Message type "caffe.LayerParameter" has no field named "multi_stage_meanfield_param". F0221 16:34:13.799583 11631 upgrade_proto.cpp:79] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: TVG_CRFRNN_new_deploy.prototxt Check failure stack trace: Aborted (core dumped)

Anyone know the reason? Thanks very much.

bittnt commented 7 years ago

For new code. There is different name for this. Please check.

youngboy94 commented 7 years ago

I meet the same question...Is there anybody fixed it?

bittnt commented 7 years ago

For new version crfasrnn. You can use something as below.

layer {
  name: "inference1"
  type: "MultiStageMeanfield"
  bottom: "unary"
  bottom: "Q0"
  bottom: "data"
  top: "score_post"
  param {
    lr_mult: 1000
  }
  param {
    lr_mult: 1000
  }
  param {
   lr_mult: 1000
  }
  multi_stage_meanfield_param {
    spatial_filter_weights_str: "3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3"
    bilateral_filter_weights_str: "5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5"
    num_iterations: 5
    compatibility_mode: POTTS
    threshold: 2
    theta_alpha: 59
    theta_beta: 3
    theta_gamma: 3
   }
}
zhangyeaixuexi commented 7 years ago

when I make Makefile.confige,I meet the same warning.Then I run the demo 'crfasrnn_demo.py',I can get the right result.But when I run the 'solve.py',there is an error like below: I0423 22:03:28.875362 13089 solver.cpp:87] Creating training net from net file: TVG_CRFRNN_COCO_VOC_TRAIN_3_CLASSES.prototxt [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 680:31: Message type "caffe.LayerParameter" has no field named "multi_stage_meanfield_param". F0423 22:03:28.875931 13089 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: TVG_CRFRNN_COCO_VOC_TRAIN_3_CLASSES.prototxt Check failure stack trace: Anyone know the reason? Thanks very much.

CallmeNezha commented 7 years ago

Meet the same issue: W0514 11:01:08.511304 3338499008 _caffe.cpp:142] Net('TVG_CRFRNN_new_deploy.prototxt', 1, weights='TVG_CRFRNN_COCO_VOC.caffemodel') [libprotobuf ERROR google/protobuf/text_format.cc:299] Error parsing text-format caffe.NetParameter: 619:31: Message type "caffe.LayerParameter" has no field named "multi_stage_meanfield_param". F0514 11:01:08.513669 3338499008 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: TVG_CRFRNN_new_deploy.prototxt Check failure stack trace: Abort trap: 6

I think this 'TVG_CRFRNN_new_deploy.prototxt' protobuf isn't match with caffemodel?

bittnt commented 7 years ago

Because you are not using our default customized caffe.

mawubin commented 7 years ago

recompile the caffe in https://github.com/torrvision/caffe.git, I solve it

superxiaoying commented 7 years ago

@bittnt Hello ,I use the caffe here https://github.com/torrvision/caffe ,and compile caffe successfully . but when i run the crfasrnn_demo.py , still has the problem "Message type "caffe.LayerParameter" has no field named "multi_stage_meanfield_param""

Can you please give me some advice? Thank you

Sam813 commented 7 years ago

@superxiaoying I have the same problem, I tried to replace the code given by @bittnt in TVG_CRFRNN_new_deploy.prototxt file but still I have the same problem. the running result for crfasrnn_demo.py for your reference:

Input file: input.jpg Output file: output.png GPU device ID: 0 [libprotobuf ERROR google/protobuf/text_format.cc:299] Error parsing text-format caffe.NetParameter: 619:31: Message type "caffe.LayerParameter" has no field named "multi_stage_meanfield_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F1106 12:43:21.102355 11808 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: TVG_CRFRNN_new_deploy.prototxt Check failure stack trace:

Can you please advise? Thanks

cv-shiyanshi commented 5 years ago

@jiaozizhao Hi,I have meet the same question as you. Can you please give me some advice? Thank you

src/caffe/layers/multi_stage_meanfield.cpp:79:13: warning: ignoring return value of ‘int fscanf(FILE, const char, ...)’, declared with attribute warn_unusedresult [-Wunused-result] fscanf(pFile, "%lf", &this->blobs[1]->mutable_cpudata()[i * channels + i]);

.build_release/lib/libcaffe.so: undefined reference to cv::imdecode(cv::_InputArray const&, int)' .build_release/lib/libcaffe.so: undefined reference toleveldb::DB::Open(leveldb::Options const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, leveldb::DB**)' .build_release/lib/libcaffe.so: undefined reference to mdb_cursor_open' .build_release/lib/libcaffe.so: undefined reference tomdb_env_set_mapsize' .build_release/lib/libcaffe.so: undefined reference to mdb_dbi_close' .build_release/lib/libcaffe.so: undefined reference tomdb_dbi_open' .build_release/lib/libcaffe.so: undefined reference to `leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)' collect2: error: ld returned 1 exit status Makefile:578: recipe for target '.build_release/tools/caffe.bin' failed make: *** [.build_release/tools/caffe.bin] Error 1