多分类focal loss 的训练 bug
Created by: HUSTLX
原来的cost是注释掉的那个fluid.layers.softmax_with_cross_entropy
我改成一个focal loss
报这个错:Traceback (most recent call last): File "train.py", line 473, in main() File "train.py", line 469, in main train(args) File "train.py", line 298, in train args=args) File "train.py", line 263, in build_program optimizer.minimize(avg_cost) File "</ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/decorator.pyc:decorator-gen-20>", line 2, in minimize File "/ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl return wrapped_func(*args, **kwargs) File "/ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/paddle/fluid/dygraph/base.py", line 88, in impl return func(*args, kwargs) File "/ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 593, in minimize no_grad_set=no_grad_set) File "/ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/paddle/fluid/optimizer.py", line 493, in backward no_grad_set, callbacks) File "/ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/paddle/fluid/backward.py", line 570, in append_backward input_grad_names_set=input_grad_names_set) File "/ssd1/lixin41/terror/anaconda2/lib/python2.7/site-packages/paddle/fluid/backward.py", line 310, in append_backward_ops op.desc, cpt.to_text(no_grad_dict[block.idx]), grad_sub_block_list) paddle.fluid.core_avx.EnforceNotMet: grad_op_maker_ should not be null Operator GradOpMaker has not been registered. at [/paddle/paddle/fluid/framework/op_info.h:69] PaddlePaddle Call Stacks: 0 0x7f585e421bc8p void paddle::platform::EnforceNotMet::Initstd::string(std::string, char const, int) + 360 1 0x7f585e421f17p paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const, int) + 87 2 0x7f585e422edcp paddle::framework::OpInfo::GradOpMaker() const + 108 3 0x7f585e41a48ep 4 0x7f585e4545c6p 5 0x7f5894841274p PyEval_EvalFrameEx + 32020 6 0x7f5894842a99p PyEval_EvalCodeEx + 2025 7 0x7f589483ff68p PyEval_EvalFrameEx + 27144 8 0x7f5894842a99p PyEval_EvalCodeEx + 2025 9 0x7f589483ff68p PyEval_EvalFrameEx + 27144 10 0x7f5894842a99p PyEval_EvalCodeEx + 2025 11 0x7f589483ff68p PyEval_EvalFrameEx + 27144 12 0x7f5894842a99p PyEval_EvalCodeEx + 2025 13 0x7f58947cb7c7p 14 0x7f58947a6b73p PyObject_Call + 67 15 0x7f589483ba6ep PyEval_EvalFrameEx + 9486 16 0x7f5894842a99p PyEval_EvalCodeEx + 2025 17 0x7f58947cb7c7p 18 0x7f58947a6b73p PyObject_Call + 67 19 0x7f589483ba6ep PyEval_EvalFrameEx + 9486 20 0x7f5894842a99p PyEval_EvalCodeEx + 2025 21 0x7f589483ff68p PyEval_EvalFrameEx + 27144 22 0x7f5894842a99p PyEval_EvalCodeEx + 2025 23 0x7f589483ff68p PyEval_EvalFrameEx + 27144 24 0x7f5894842a99p PyEval_EvalCodeEx + 2025 25 0x7f589483ff68p PyEval_EvalFrameEx + 27144 26 0x7f5894842a99p PyEval_EvalCodeEx + 2025 27 0x7f589483ff68p PyEval_EvalFrameEx + 27144 28 0x7f5894842a99p PyEval_EvalCodeEx + 2025 29 0x7f589483ff68p PyEval_EvalFrameEx + 27144 30 0x7f5894842a99p PyEval_EvalCodeEx + 2025 31 0x7f5894842cbap PyEval_EvalCode + 26 32 0x7f589485c01dp 33 0x7f589485d1c8p PyRun_FileExFlags + 120 34 0x7f589485e3e8p PyRun_SimpleFileExFlags + 232 35 0x7f589487067cp Py_Main + 2988 36 0x7f5893a59b45p __libc_start_main + 245 37 0x7f589494207fp