PatrickLib / captcha_recognize

Image Recognition captcha without image segmentation 无需图片分割的验证码识别
Apache License 2.0
557 stars 174 forks source link

module 'tensorflow' has no attribute 'app' #28

Open mignom opened 2 years ago

mignom commented 2 years ago

Hi. in captcha_records.py stroke 123 it says: AttributeError: module 'tensorflow' has no attribute 'app' i changed tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) to tf.compat.v1.run(main=main, argv=[sys.argv[0]] + unparsed) now it says module 'tensorflow.compat.v1' has no attribute 'run'

SecurityEnthusiast commented 1 year ago

Hi @mignom

It is right. compat.v1 doesn`t have run attribute. You have to replace it with this line:

tf.compat.v1.app.run(main=main, argv=[sys.argv[0]] + unparsed)