caffe-windows icon indicating copy to clipboard operation
caffe-windows copied to clipboard

Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: SGD (known types: )

Open wucs0329 opened this issue 7 years ago • 8 comments

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

wucs0329 avatar Jun 23 '17 18:06 wucs0329

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..

happynear avatar Jun 23 '17 20:06 happynear

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.

wucs0329 avatar Jun 23 '17 22:06 wucs0329

Bakup your memory_data_layer, then download a new code and copy the files back.

happynear avatar Jun 24 '17 05:06 happynear

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: ***

ngcthuong avatar Jul 11 '17 06:07 ngcthuong

@AtenaKid,

What you need is different. Please refer to the first question in FAQ.md.

happynear avatar Jul 11 '17 14:07 happynear

@happynear Thank you, I already find the solution. It would be nice if you can add more cpp example.

ngcthuong avatar Jul 12 '17 03:07 ngcthuong

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. image

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.

ngcthuong avatar Jul 28 '17 01:07 ngcthuong

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.

happynear avatar Jul 28 '17 01:07 happynear