cnn_captcha
cnn_captcha copied to clipboard
Input to reshape is a tensor with 10 values, but the requested shape requires a multiple of 40
运行webserver_recognize_api.py
后,向接口post图片文件时,报以下错误:
Traceback (most recent call last): File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1365, in _do_call return fn(*args) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1350, in _run_fn target_list, run_metadata) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 10 values, but the requested shape requires a multiple of 40 [[{{node Reshape_2}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 2464, in call return self.wsgi_app(environ, start_response) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/Users/mac/Desktop/hello/webserver_recognize_api.py", line 68, in up_image value = R.rec_image(img) File "/Users/mac/Desktop/hello/cnnlib/recognition_object.py", line 51, in rec_image text_list = sess.run(self.predict, feed_dict={self.X: [test_image], self.keep_prob: 1.}) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 958, in run run_metadata_ptr) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1181, in _run feed_dict_tensor, options, run_metadata) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1359, in _do_run run_metadata) File "/Users/mac/Desktop/hello/venv/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1384, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 10 values, but the requested shape requires a multiple of 40 [[node Reshape_2 (defined at /cnnlib/recognition_object.py:34) ]]
Errors may have originated from an input operation. Input Source operations connected to node Reshape_2: y_prediction/Add (defined at /cnnlib/network.py:103)
Original stack trace for 'Reshape_2':
File "/webserver_recognize_api.py", line 45, in