caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Solver `CheckType()` is faulty and direct instantiation fails

Open wadefelix opened this issue 10 years ago • 1 comments

When specify the solver type in the solver.prototxt, CheckType failed.

#5009 is wrong @shelhamer

virtual function type() shouldn't be called in constructors. http://stackoverflow.com/questions/962132/calling-virtual-functions-inside-constructors

wadefelix avatar Nov 25 '16 07:11 wadefelix

@wadefelix Thanks for catching this! I thought the tests would have caught this mistake regarding virtuals but apparently not. get_solver() continues to work but direct instantiation by caffe.AdamSolver() for instance does not.

I'll try to remedy this as soon as possible. For now I've reverted the commit by b644a87.

@cypof we can't rely on this for parallel solvers.

shelhamer avatar Nov 25 '16 20:11 shelhamer