qjadud1994 / CRNN-Keras

CRNN (CNN+RNN) for OCR using Keras / License Plate Recognition
MIT License
521 stars 191 forks source link

Invalid argument: slice index 0 of dimension 0 out of bounds. #52

Open musician-k opened 4 years ago

musician-k commented 4 years ago

I run trianing.py, occur this error

the detail information is:

tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: slice index 0 of dimension 0 out of bounds. [[node ctc/scan/strided_slice (defined at \Users\QZK\anaconda3\envs\crnn_keras\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]] [[ctc/ToInt32_2/_503]] (1) Invalid argument: slice index 0 of dimension 0 out of bounds. [[node ctc/scan/strided_slice (defined at \Users\QZK\anaconda3\envs\crnn_keras\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]] 0 successful operations. 0 derived errors ignored.

Original stack trace for 'ctc/scan/strided_slice': File "/ML_Projects/CRNN-Keras-master-new/training.py", line 16, in model = get_Model(training=True) File "\ML_Projects\CRNN-Keras-master-new\Model.py", line 86, in get_Model loss_out = Lambda(ctc_lambda_func, output_shape=(1,), name='ctc')([y_pred, labels, input_length, label_length]) #(None, 1) File "\Users\QZK\anaconda3\envs\crnn_keras\lib\site-packages\keras\engine\topology.py", line 617, in call output = self.call(inputs, kwargs) File "\Users\QZK\anaconda3\envs\crnn_keras\lib\site-packages\keras\layers\core.py", line 663, in call return self.function(inputs, arguments) File "\ML_Projects\CRNN-Keras-master-new\Model.py", line 17, in ctc_lambda_func return K.ctc_batch_cost(labels, y_pred, input_length, label_length) File "\Users\QZK\anaconda3\envs\crnn_keras\lib\site-packages\keras\backend\tensorflow_backend.py", line 3941, in ctc_batch_cost sparse_labels = tf.to_int32(ctc_label_dense_to_sparse(y_true, label_length))

tim20120526 commented 3 years ago

hi ,have you solved it?