Open starkdm opened 5 years ago
The class SolverRegistry is a singleton, it is define in a header file. In dll it has an instance. but the caffe.cpp has another one. Ttey init different.
fix:
in solver_factory.hpp, add two functions declare:
Solver
create new file names with solver_factory.cpp add content:
namespace caffe {
Solver<float>* CreateFloatFloatSolver(const SolverParameter& param)
{
return SolverRegistry<float>::CreateSolver(param);
}
Solver<double>* CreateFloatDoubleSolver(const SolverParameter& param)
{
return SolverRegistry<double>::CreateSolver(param);
}
}
in caffe.cpp change
shared_ptr<caffe::Solver
to
shared_ptr<caffe::Solver
it will be ok.
Do you offer to edit caffe.cpp and recompile the library?
I solved the problem differently (specify solver):
boost::shared_ptr<AdamSolver<double>> solver(new AdamSolver<double>(solverParam));
your solution better, then use yours.
i did not offer my change .
------------------ 原始邮件 ------------------ 发件人: "starkdm"notifications@github.com; 发送时间: 2019年10月9日(星期三) 凌晨5:09 收件人: "BVLC/caffe"caffe@noreply.github.com; 抄送: "无咎"474341520@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [BVLC/caffe] Unknown solver type: SGD (#6793)
Do you offer to edit caffe.cpp and recompile the library?
I solved the problem differently (specify solver):
boost::shared_ptr<AdamSolver
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
I'm trying to build Caffe under Windows 10 and use it in my Visual Studio C++ project (VS 2017, v141 toolset). The build was successful as the libraries linking (although I had to have difficulties). I conducted tests after the build, and also ran "runtest" project. All tests were successfully.
Caffe build options:
Program has triggered a breakpoint when
CreateSolver
method called. Full output:main.cpp: https://pastebin.com/w43ZgaXZ solver.prototxt: https://pastebin.com/Dt2hym79