securimage_solver icon indicating copy to clipboard operation
securimage_solver copied to clipboard

Not working python 3.7.3

Open githubuser441 opened this issue 5 years ago • 2 comments

It seems like the script is not working anymore. On what version was it working?

Error log: `C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) WARNING: Logging before flag parsing goes to stderr. W0727 18:37:58.708501 9856 deprecation_wrapper.py:119] From C:\Users\name\Documents\namesecurimage_solver-master\captcha_model.py:47: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.

W0727 18:37:58.709480 9856 deprecation_wrapper.py:119] From C:\Users\name\Documents\namesecurimage_solver-master\captcha_model.py:33: The name tf.get_variable is deprecated. Please use tf.compat.v1.get_variable instead.

W0727 18:37:58.722735 9856 deprecation_wrapper.py:119] From C:\Users\name\Documents\namesecurimage_solver-master\captcha_model.py:25: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0727 18:37:58.760635 9856 deprecation.py:506] From C:\Users\name\Documents\namesecurimage_solver-master\captcha_model.py:87: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. W0727 18:37:58.771610 9856 deprecation_wrapper.py:119] From .\captcha_api.py:56: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.

W0727 18:37:58.783582 9856 deprecation_wrapper.py:119] From .\captcha_api.py:57: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

W0727 18:37:58.796574 9856 deprecation.py:323] From C:\Users\name\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\training\saver.py:1276: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. Traceback (most recent call last): File ".\captcha_api.py", line 69, in main() File ".\captcha_api.py", line 66, in main print(predict(path)) File ".\captcha_api.py", line 61, in predict text = one_hot_to_texts(recog_result) File ".\captcha_api.py", line 29, in one_hot_to_texts for i in xrange(recog_result.shape[0]): NameError: name 'xrange' is not defined`

githubuser441 avatar Jul 27 '19 16:07 githubuser441

Hey, I think I developed the script in Python 2. Replacing xrange with range should fix it I think.

sampritipanda avatar Jul 27 '19 22:07 sampritipanda

I just merged the pip package PR. It has the necessary changes to work on Python3 and can be installed by running pip install https://github.com/sampritipanda/securimage_solver/archive/pip_package.zip

And can be used as:

from securimage_solver import CaptchaApi
c = CaptchaApi()
c.predict('/path/to/image.png')

ArionMiles avatar Jul 28 '19 06:07 ArionMiles