先安裝必須的庫
tensorflow_gpu==1.15.0 numpy opencv_python
github:
https://github.com/bai-shang/crnn_ctc_ocr_tf
下載數據集:
http://www.robots.ox.ac.uk/~vgg/data/text/mjsynth.tar.gz
要10G
然后解壓縮,估計完整解壓完需要1天



find ./mnt/ | xargs ls -d | grep jpg > image_list_all.txt # use some of data to train and eval cat image_list_all.txt | head -n 1000 > image_list.txt


這個文件的圖片txt將會作為輸入,然后生成tfrecord
python create_synth90k_tfrecord.py --image_dir C:\Users\McKay\PycharmProjects\test8\tfdemo\data --anno_file ./image_list.txt --char_map_json_file ../char_map/char_map.json

然后就是訓練了

參數:
--data_dir ../data/tfrecords/ --model_dir ./model/ --batch_size 32 --char_map_json_file ../char_map/char_map.json

沒有GPU,訓練了4個小時,也只是7%的正確率
果斷中斷,有緣再用GPU訓練。
