Old problem, still no solution: Unknown solver type: SGD

211 views
Skip to first unread message

Peter Neher

unread,
Feb 2, 2017, 2:33:18 AM2/2/17
to Caffe Users
Hi everyone,

I am trying to use Caffe as external library in my C++ project. It compiles fine, but the old "Check failed: registry.count(type) == 1 (0 vs. 1) Unknown solver type: SGD (known types: )" occurs.
I have found discussions about this issue everywhere, but no solution that helped. I am using Ubuntu 16.04, Cmake and I built Caffe with shared libraries. Do I need to define some variable in my projects Cmake to enable registration of the solvers and layers?

Any help is much appreciated!

Peter

Peter Neher

unread,
Feb 3, 2017, 4:06:39 AM2/3/17
to Caffe Users
It works now when directly using the SGDSolver Class
caffe::Solver<float>* solver = new caffe::SGDSolver<float>(solver_param);

instead of
caffe::shared_ptr<caffe::Solver<float> > solver(caffe::SolverRegistry<float>::CreateSolver(solver_param));

Atena Nguyen

unread,
Jul 11, 2017, 2:40:47 AM7/11/17
to Caffe Users
I follow your suggestion and get another error of C2061: syntax error: identifier SGDSolver. 
Any idea to fix it? 

Vào 18:06:39 UTC+9 Thứ Sáu, ngày 03 tháng 2 năm 2017, Peter Neher đã viết:

Atena Nguyen

unread,
Jul 11, 2017, 2:52:01 AM7/11/17
to Caffe Users
I have fixed this error by simply add #include "caffe/sgd_solver.hpp" and got another error

I0711 15:46:18.446548  8916 layer_factory.hpp:77] Creating layer mnist
F0711
15:46:18.447049  8916 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Data (known types: )
*** Check failure stack trace: ***


Vào 15:40:47 UTC+9 Thứ Ba, ngày 11 tháng 7 năm 2017, Atena Nguyen đã viết:
I follow your suggestion and get another error of C2061: syntax error: identifier SGDSolver. 
Any idea to fix it? 

r
Reply all
Reply to author
Forward
0 new messages