MTCNN-Tensorflow icon indicating copy to clipboard operation
MTCNN-Tensorflow copied to clipboard

gen_hard_example出错:Key fc1/alphas not found in checkpoint

Open ddxu opened this issue 7 years ago • 12 comments

@AITTSMD 您好,感谢您的开源工作。 想通过您的工作熟悉一下MTCNN的训练过程,我已经按照您的指引以默认配置完成了PNet的训练,接下来是按照【After training PNet, run gen_hard_example to generate training data(Face Detection Part) for RNet.】的指引,运行gen_hard_example脚本生成RNet的训练数据,但是总是出错,在加载预训练模型RNet-14的model时出错: ../data/MTCNN_model/RNet_landmark/RNet-14 restore models' param 2017-11-01 16:41:20.483995: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key fc1/alphas not found in checkpoint 2017-11-01 16:41:20.484165: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key fc1/alphas not found in checkpoint 请教该如何解决?

ddxu avatar Nov 01 '17 00:11 ddxu

@ddxu 您好,注意检查您的tensorflow的版本,我用的是1.2.1

AITTSMD avatar Nov 01 '17 01:11 AITTSMD

使用的版本的是1.3.0 遇到了同样的问题,看来只能降版本了

ghost avatar Nov 01 '17 06:11 ghost

@ddxu it should be solved by: https://github.com/AITTSMD/MTCNN-Tensorflow/commit/519b453975a8dbdc7b0eecdb4f8735b7b6c80d46

ilyanelken avatar Nov 01 '17 08:11 ilyanelken

把楼上的那次commit还原之后,去掉最后那个参数,竟然可以正常运行了...

ghost avatar Nov 01 '17 08:11 ghost

按照楼上的去掉最后那个参数 #fc1 = slim.fully_connected(fc_flatten, num_outputs=256,scope="fc1", activation_fn=prelu) 改成 fc1 = slim.fully_connected(fc_flatten, num_outputs=256,scope="fc1")就可以了!

94happy avatar Nov 03 '17 12:11 94happy

@ilyanelken Hi, can you specify where you find the original author needs some "special" relu act function for Rnet and Onet? I check the paper and author's code?

flankechen avatar Nov 24 '17 07:11 flankechen

@ilyanelken and I think that prelu act function is already as default in the arg scope.

flankechen avatar Nov 24 '17 07:11 flankechen

@flankechen Hi, you can see the original code that was written by the author's: https://github.com/kpzhang93/MTCNN_face_detection_alignment/blob/master/code/codes/MTCNNv1/model/det2.prototxt There is PReLU. The arg scope is valid for conv2d ops only and not fully_connected

ilyanelken avatar Jan 22 '18 21:01 ilyanelken

what are you talking about? I faced the same problem, anyone who knows the solution?please give a hand

WangJianXin666 avatar Apr 09 '18 06:04 WangJianXin666

I faced the same problem. I solve it through set test_model to 'PNet', because I only have PNet after training PNet.

tjusxh avatar May 09 '18 06:05 tjusxh

python ./gen_hard_example.py --test_mode=PNet

gysan avatar Sep 10 '18 15:09 gysan

@ddxu it should be solved by: 519b453

@ilyanelken do we need to regularize the parameters in fully connected layers?

TengliEd avatar Nov 21 '19 11:11 TengliEd