YCG09 / chinese_ocr

CTPN + DenseNet + CTC based end-to-end Chinese OCR implemented using tensorflow and keras
Apache License 2.0
2.75k stars 1.08k forks source link

训练时总在最后一个batch_size出错 #187

Open dk-liang opened 5 years ago

dk-liang commented 5 years ago

1950/1951 [============================>.] - ETA: 0s - loss: 8.4040 - acc: 0.4205Traceback (most recent call last): File "train.py", line 174, in callbacks = [checkpoint, earlystop, changelr, tensorboard]) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, *kwargs) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/engine/training.py", line 1418, in fit_generator initial_epoch=initial_epoch) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/engine/training_generator.py", line 234, in fit_generator workers=0) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(args, kwargs) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/engine/training.py", line 1472, in evaluate_generator verbose=verbose) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/engine/training_generator.py", line 330, in evaluate_generator generator_output = next(output_generator) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/data_utils.py", line 709, in get six.reraise(sys.exc_info()) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/six.py", line 693, in reraise raise value File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/data_utils.py", line 685, in get inputs = self.queue.get(block=True).get() File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/multiprocessing/pool.py", line 670, in get raise self._value File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(args, kwds)) File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/data_utils.py", line 626, in next_sample return six.next(_SHARED_SEQUENCES[uid]) File "train.py", line 98, in gen img1 = Image.open(os.path.join(image_path, j)).convert('L') File "/home/kdliang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/PIL/Image.py", line 2634, in open fp = builtins.open(filename, "rb") IsADirectoryError: [Errno 21] Is a directory: './images/'

请问是什么问题

yanshui177 commented 5 years ago

同问

WHQCHINA commented 5 years ago

可能是图像文件里面有文件夹存在

Lanme commented 5 years ago

问下你们训练用了多久?