caffe-windows
caffe-windows copied to clipboard
Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: SGD (known types: )
Hello, When I tun the train program, it response Unknown solver type: SGD. I think maybe caffe can't read the known type. What should I do to solve? Thanks, Chunsheng
SGD is definitely a known optimization algorithm. Your caffe.exe is not built correctly. I don't clearly know why, please download the code and compile again..
Thank you for your reply.
I have a lot change in memory_data_layer.cpp, because I want use the memory data to train net. I often need to change train data, so it is very useful to read train data from memory for me. would you please tell me how to implement the function? Thanks again!
Chunsheng Wu
-----原始邮件----- 发件人: "Feng Wang" [email protected] 发送时间: 2017年6月23日 星期五 收件人: happynear/caffe-windows [email protected] 抄送: wucs0329 [email protected], Author [email protected] 主题: Re: [happynear/caffe-windows] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: SGD (known types: ) (#214)
SGD is definitely a known optimization algorithm. Your caffe.exe is not built correctly. I don't clearly know why, please download the code and compile again..
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Bakup your memory_data_layer, then download a new code and copy the files back.
I also face the same problem with MNIST in visual studio. The file compiles successfully but got error while running exe file.
Is there any solution other than trying to build Caffe again?
My cpp code
#include "caffe/caffe.hpp"
#include "caffe/util/io.hpp"
#ifdef USE_OPENCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#endif // USE_OPENCV
#include "boost/smart_ptr/shared_ptr.hpp"
// Caffe's required library
#pragma comment(lib, "caffe.lib")
// enable namespace
using namespace std;
using namespace cv;
using namespace boost;
using namespace caffe;
// caffe training
int train()
{
// parse solver parameters
string solver_prototxt = "lenet_solver1.prototxt";
caffe::SolverParameter solver_param;
caffe::ReadProtoFromTextFileOrDie(solver_prototxt, &solver_param);
// set device id and mode
Caffe::set_mode(Caffe::CPU);
boost::shared_ptr<caffe::Solver<float> > solver(caffe::SolverRegistry<float>::CreateSolver(solver_param));
// start solver
solver->Solve();
LOG(INFO) << "Optimization Done.";
return 0;
}
int main() {
train();
}
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0711 15:09:12.852984 12428 solver_factory.hpp:76] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: SGD (known types: )
*** Check failure stack trace: ***
@AtenaKid,
What you need is different. Please refer to the first question in FAQ.md.
@happynear Thank you, I already find the solution. It would be nice if you can add more cpp example.
I'm very sorry for newbie question but I can not follow your FAQ for
check failed: registry.count(type)==1(0 vs 1)unknown layer type
You stated two solutions. The first one is to setting property of project
Common Property - Reference - caffelib - Project Reference Property - Library Dependency Link: True .
But I don't know how to change this thing. In my Property Pages, there is no reference tab.
I am using Visual studio 2015.
For the second method, I need to add layer_factory.cpp
and force_link.cpp
but again I could not find force_link.cpp
anywhere in caffe-window directory.
Will you give a little more details on this problem.
Thank you for your time.
That was the guidance for VS2013... In VS2015, the Reference of each project is in the drop-down menu of the project, above the cpp and h files.