weinman / cnn_lstm_ctc_ocr

Tensorflow-based CNN+LSTM trained with CTC-loss for OCR
GNU General Public License v3.0
497 stars 170 forks source link

Empty output in validate.py #18

Closed hiepph closed 6 years ago

hiepph commented 6 years ago

For prediction of some real images, I ran your script:

cd src ; python validate.py < ~/paths_to_images.txt

and received empty output (it didn't print anything into screen). I went to check your code and found this line:

[output] = sess.run(prediction,{ image: image_data, width: image_data.shape[1]} )

and tried to print(output):

SparseTensorValue(indices=array([], shape=(0, 2), dtype=int64), values=array([], dtype=int64), dense_shape=array([1, 0]))

As expected its values is an empty array [].

What went wrong?

weinman commented 6 years ago

Your model might be only predicting blanks.