zakizhou / captcha Goto Github PK
View Code? Open in Web Editor NEWimplement classification for CAPTCHA in TensorFlow
implement classification for CAPTCHA in TensorFlow
Traceback (most recent call last):
File "CNN/captcha_generator.py", line 8, in
from captcha.image import ImageCaptcha
File "/home/hui/Downloads/CAPTCHA-master/CNN/captcha.py", line 20
tf.constant_initializer(value=0),
^
SyntaxError: positional argument follows keyword argument
you import "from captcha.image import ImageCaptcha", but it is not found in CAPTCHA.py, is it a separate module then where to import ImageCAPTCHA module?
hi , thanks for sharing your code with us , could you tell us how could we use the trained saved model ?????
Alphabets Possible?
I get the following error upon executing captcha_train.py. Suggest where could have this code gone wrong. I followed readme file to the dot.
Traceback (most recent call last):
File "model/captcha_train.py", line 85, in <module>
main()
File "model/captcha_train.py", line 79, in main
coord.join(threads)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/queue_runner_impl.py", line 238, in _run
enqueue_callable()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1231, in _single_operation_run
target_list_as_strings, status, None)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 24375 values, but the requested shape has 24576
[[Node: Reshape = Reshape[T=DT_UINT8, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](DecodeRaw, Reshape/shape)]]
Hi, zakizhou
I have a question about the calculation of accuracy.
a correct prediction means every chars in a image are correctly predicted.
for example, if label=[a,b,c,d] and prediction=[a,b,c,e], for one example the accuracy is 0, not 75%
am I right? hope your reply
Hello,
I've just got follow error after I tried to execute this command:
python model/captcha_train.py
Can you help with this? I am sorry if it is a silly question, but I am just getting started to work with TensorFlow...
Traceback (most recent call last):
File "model/captcha_train.py", line 82, in
main()
File "model/captcha_train.py", line 44, in main
loss = captcha_model.loss(logits, labels)
File "/home/samir/Downloads/CAPTCHA/model/captcha_model.py", line 123, in loss
cross_entropy_per_number = tf.nn.softmax_cross_entropy_with_logits(logits, labels)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 491, in softmax_cross_entropy_with_logits
precise_logits, labels, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 1427, in _softmax_cross_entropy_with_logits
features=features, labels=labels, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2319, in create_op
set_shapes_for_outputs(ret)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1711, in set_shapes_for_outputs
shapes = shape_func(op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 603, in _SoftmaxCrossEntropyWithLogitsShape
input_shape = logits_shape.merge_with(labels_shape).with_rank(2)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_shape.py", line 641, in with_rank
raise ValueError("Shape %s must have rank %d" % (self, rank))
ValueError: Shape (128, 4, 10) must have rank 2
I have cloned your code and run in my computer. The loss decreased but the validation accuracy is around 11% and didn't increase. I don't understand why and am very confused. Do you have any insight into the problem? Thank you very much.
Hi zakizhou
This is a wonderful work, i would like to know that how much accuracy you have achieved on your model?
$ python ./captcha_train.py
WARNING:tensorflow:From /Library/Python/2.7/site-packages/tensorflow/python/util/tf_should_use.py:175: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use tf.global_variables_initializer
instead.
WARNING:tensorflow:From /Library/Python/2.7/site-packages/tensorflow/python/util/tf_should_use.py:175: initialize_local_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use tf.local_variables_initializer
instead.
2017-07-19 14:22:41.402951: 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.
2017-07-19 14:22:41.402975: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-07-19 14:22:41.402980: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-07-19 14:22:41.402984: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Done training -- epoch limit reached
Time Consumption: 0:00:00.061753
Traceback (most recent call last):
File "./captcha_train.py", line 82, in
main()
File "./captcha_train.py", line 76, in main
coord.join(threads)
File "/Library/Python/2.7/site-packages/tensorflow/python/training/coordinator.py", line 389, in join
six.reraise(*self._exc_info_to_raise)
File "/Library/Python/2.7/site-packages/tensorflow/python/training/queue_runner_impl.py", line 238, in _run
enqueue_callable()
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1235, in _single_operation_run
target_list_as_strings, status, None)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 24, in exit
self.gen.next()
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: ../images/tfrecords/train.tfrecords
[[Node: ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/cpu:0"](TFRecordReaderV2, input_producer)]]
What is the reason for this error when I execute?
tensorflow '1.2.1'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.