bgshih / aster

Recognizing cropped text in natural images.
MIT License
727 stars 195 forks source link

pos 0 out of range for stringb'' at index 0 #78

Closed tygrer closed 5 years ago

tygrer commented 5 years ago

Does someone meet this issue before? I tried to retrain the model by sovling the chinese character recognition. And I used the number to replace the character, and splite by '$'. But when I run the train.py script, here the issue showed. INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, pos 0 out of range for stringb'' at index 0 [[Node: Input/case_1/If_0/decode_image/Substr = Substr[T=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Input/case_1/If_0/decode_image/Substr/Switch:1, Input/case_1/If_0/decode_image/Substr/pos, Input/case_1/If_0/decode_image/Substr/len)]] INFO:tensorflow:Saving checkpoints for 68 into /home/tanggy/aster/experiments/demo/log/model.ckpt. Traceback (most recent call last): File "aster/train.py", line 216, in tf.app.run() File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "aster/train.py", line 212, in main worker_job_name, is_chief, train_dir) File "/home/tanggy/aster/trainer.py", line 268, in train config=session_config File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/contrib/training/python/training/training.py", line 538, in train loss = session.run(train_op) File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 537, in exit self._close_internal(exception_type) File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 574, in _close_internal self._sess.close() File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 820, in close self._sess.close() File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 941, in close ignore_live_threads=True) File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 389, in join six.reraise(*self._exc_info_to_raise) File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/six.py", line 685, in reraise raise value.with_traceback(tb) File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/queue_runner_impl.py", line 238, in _run enqueue_callable() File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1231, in _single_operation_run target_list_as_strings, status, None) File "/home/tanggy/anaconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: pos 0 out of range for stringb'' at index 0 [[Node: Input/case_1/If_0/decode_image/Substr = Substr[T=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Input/case_1/If_0/decode_image/Substr/Switch:1, Input/case_1/If_0/decode_image/Substr/pos, Input/case_1/If_0/decode_image/Substr/len)]]

tygrer commented 5 years ago

This is my dataset issue. I resovled by clean the dirty data.