-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CNN网站验证码训练后重复预测异常 #16
Comments
重新写个测试更明显点
2017-11-02 14:34:54.950657: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. |
问题好像是:重试时不要重复定义CNN,即crack_captcha_cnn只执行一次复用即可解决 |
你解决了吗?好像问题不在这 |
我每次都是创建一个新的对象去处理,肯定是执行了一次 |
@1513 crack_captcha_cnn只执行一次,如果在对象里就要处理成单例模式 |
@xiefg 我已经解决了需要重置tf.reset_default_graph(),每次识别前需要进行这个操作,感谢您的回复,另外,要不要设置成单例,多线程下要不要同步处理,不清楚,我试过python多线程跑,好像没有问题 |
@ 1513 ,重置tf.reset_default_graph()代码会报错,你的重置放哪了? |
使用tensorflow_cnn进行验证码训练并预测,图片预测成功率很高,但是图片验证码样本是根据目标网站自己用PHP模拟生成,几乎接近一致,训练后使用模型进行目标网站的登录,登录逻辑为了防止验证码失败,会有重试,login是个循环,失败了掉login,login里会读取验证码图片调用crack_captcha,当第一次验证准确时直接登录成功,当第一次验证失败,重新调用登录去再读取验证码图片进行预测时报异常,然后N次循环都报异常,而且每一次重试,会增加异常的数量,异常如下:
alert('验证码错误');
9006
2017-11-02 10:22:14.369586: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_11 not found in checkpoint
2017-11-02 10:22:14.369586: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_10 not found in checkpoint
2017-11-02 10:22:14.369586: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_12 not found in checkpoint
2017-11-02 10:22:14.371381: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_14 not found in checkpoint
2017-11-02 10:22:14.371404: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_15 not found in checkpoint
2017-11-02 10:22:14.371410: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_13 not found in checkpoint
2017-11-02 10:22:14.372782: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_17 not found in checkpoint
2017-11-02 10:22:14.372955: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_16 not found in checkpoint
2017-11-02 10:22:14.375048: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_18 not found in checkpoint
2017-11-02 10:22:14.375149: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_19 not found in checkpoint
2393
2017-11-02 10:22:15.583424: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_10 not found in checkpoint
2017-11-02 10:22:15.584296: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_11 not found in checkpoint
2017-11-02 10:22:15.584677: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_13 not found in checkpoint
2017-11-02 10:22:15.584754: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_12 not found in checkpoint
2017-11-02 10:22:15.585934: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_14 not found in checkpoint
2017-11-02 10:22:15.586106: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_16 not found in checkpoint
2017-11-02 10:22:15.586465: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_15 not found in checkpoint
2017-11-02 10:22:15.587122: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_17 not found in checkpoint
2017-11-02 10:22:15.587133: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_18 not found in checkpoint
2017-11-02 10:22:15.588150: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_19 not found in checkpoint
2017-11-02 10:22:15.588196: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_20 not found in checkpoint
2017-11-02 10:22:15.589135: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_21 not found in checkpoint
2017-11-02 10:22:15.589325: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_22 not found in checkpoint
2017-11-02 10:22:15.591827: W tensorflow/core/framework/op_kernel.cc:1152] Not found: Key Variable_23 not found in checkpoint
The text was updated successfully, but these errors were encountered: