xbpeng / DeepTerrainRL

terrain-adaptive locomotion skills using deep reinforcement learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

caffe_mods rebuild caffe

MiaoDragon opened this issue · comments

Hi! After I copied files inside caffe_mods to the specific locations inside caffe folder, and run "make clean" and "make all", I found some errors. The following is the log:

"
src/caffe/layers/infogain_loss_layer.cpp:18:68: error: no member named 'axis' in 'caffe::InfogainLossParameter'
softmax_param->set_axis(this->layer_param_.infogain_loss_param().axis());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/caffe/layers/infogain_loss_layer.cpp:221:19: note: in instantiation of member function 'caffe::InfogainLossLayer::LayerSetUp' requested here
INSTANTIATE_CLASS(InfogainLossLayer);
^
./include/caffe/common.hpp:43:18: note: expanded from macro 'INSTANTIATE_CLASS'
template class classname;
^
src/caffe/layers/infogain_loss_layer.cpp:57:48: error: no member named 'axis' in 'caffe::InfogainLossParameter'
this->layer_param_.infogain_loss_param().axis());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/caffe/layers/infogain_loss_layer.cpp:221:19: note: in instantiation of member function 'caffe::InfogainLossLayer::Reshape' requested here
INSTANTIATE_CLASS(InfogainLossLayer);
^
./include/caffe/common.hpp:43:18: note: expanded from macro 'INSTANTIATE_CLASS'
template class classname;
^
src/caffe/layers/infogain_loss_layer.cpp:18:68: error: no member named 'axis' in 'caffe::InfogainLossParameter'
softmax_param->set_axis(this->layer_param_.infogain_loss_param().axis());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/caffe/layers/infogain_loss_layer.cpp:221:19: note: in instantiation of member function 'caffe::InfogainLossLayer::LayerSetUp' requested here
INSTANTIATE_CLASS(InfogainLossLayer);
^
./include/caffe/common.hpp:44:18: note: expanded from macro 'INSTANTIATE_CLASS'
template class classname
^
src/caffe/layers/infogain_loss_layer.cpp:57:48: error: no member named 'axis' in 'caffe::InfogainLossParameter'
this->layer_param_.infogain_loss_param().axis());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
src/caffe/layers/infogain_loss_layer.cpp:221:19: note: in instantiation of member function 'caffe::InfogainLossLayer::Reshape' requested here
INSTANTIATE_CLASS(InfogainLossLayer);
^
./include/caffe/common.hpp:44:18: note: expanded from macro 'INSTANTIATE_CLASS'
template class classname
^
4 errors generated.
make: *** [.build_release/src/caffe/layers/infogain_loss_layer.o] Error 1
"

I tried to add "label_size" to MemoryDataParameter message inside caffe.proto by hand, and copied the other files instead. However, errors still occurred when I trained the model.
I also tried to copy the caffe.proto file after make caffe, and generate "caffe.pb.h" and "caffe.pb.cc" by the following command:
protoc caffe/proto/caffe.proto --cpp_out=../include/
and then move the two files to build folder. But it also results in error when training.

Could you suggest the way to regenerate "caffe.pb.h" and "caffe.pb.cc" files? I would really appreciate your help.

you probably have a newer version of caffe, so just copying the files will likely overwrite some of the new changes. What you should do instead is to manually merge the changes in caffe.proto. Which is mostly related to the memory_data_layer. By the looks of the errors, you might be overwriting somethings related to the infogainlosslayer.

Thanks a lot for the reply! I manually added the new field "label_size" into caffe.proto, and also made changes to memory_data_layer.cpp and memory_data_layer.hpp. After this, I built caffe again and checked that caffe.pb.cc and caffe.pb.h both contained the label_size field.
However, after I make TerrainRL again, and run the following command:
./TerrainRL -arg_file= args/opt_args_train_mace.txt
I still got the following error:

"
I0921 14:30:50.332242 2112348160 solver.cpp:87] Creating training net from net file: data/policies/dog/nets/dog_mace3_train.prototxt
[libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 14:19: Message type "caffe.MemoryDataParameter" has no field named "label_size".
F0921 14:30:50.332310 2112348160 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: data/policies/dog/nets/dog_mace3_train.prototxt
*** Check failure stack trace: ***
@ 0x10b138102 google::LogMessage::Fail()
@ 0x10b137804 google::LogMessage::SendToLog()
@ 0x10b137d5b google::LogMessage::Flush()
@ 0x10b13b06d google::LogMessageFatal::~LogMessageFatal()
@ 0x10b1383ef google::LogMessageFatal::~LogMessageFatal()
@ 0x10af80985 caffe::ReadNetParamsFromTextFileOrDie()
@ 0x10af51917 caffe::Solver<>::InitTrainNet()
@ 0x10af50d50 caffe::Solver<>::Init()
@ 0x10af50a55 caffe::Solver<>::Solver()
@ 0x10abda996 caffe::SGDSolver<>::SGDSolver()
@ 0x10abda2ba cNNSolver::BuildSolver()
@ 0x10abcc62e cNeuralNet::LoadSolver()
@ 0x10abd97dd cNeuralNetTrainer::BuildNetPool()
@ 0x10abc9a2e cMACETrainer::BuildNetPool()
@ 0x10abd74d4 cNeuralNetTrainer::Init()
@ 0x10abc924c cMACETrainer::Init()
@ 0x10abf837a cScenarioTrain::InitTrainer()
@ 0x10abf7af6 cScenarioTrain::Init()
@ 0x10abed89d cDrawScenarioTrain::Init()
@ 0x10ac7c0e6 SetupScenario()
@ 0x10ac7d318 main
@ 0x7fff988895ad start
Abort trap: 6
"

It seems that label_size is still missing, even if I added it to caffe.proto and rebuilt caffe. It is so strange...

looks like something wrong with glog. You might need to rebuild that.

Thanks! The problem has been solved.