MichalBusta / DeepTextSpotter

285 stars 101 forks source link

some error occurred when train the model #68

Open ustczhouyu opened 5 years ago

ustczhouyu commented 5 years ago

Hello, when I try to train the model (python train.py), some errors occurred. I want to know what the following two files are, parser.add_argument('-train_list', default='/home/busta/data/test_icdar181.txt') parser.add_argument('-valid_list', default='/home/busta/data/ocr/list.txt') Can someone help me, thanks!

mattroos commented 5 years ago

They should contain a list of image filenames for training or validation, one per line. The filenames can be full absolute filenames (full path starting with '/') or partial names, relative to the directory in which the list file is stored. Set the -data_dir argument to the same directory name. When training using the detection model you'll also need to specify that directory name in the tiny.prototxt file, for the OnDiskLayer. Only .png and .jpg files can be used. Each image file should have a .txt file with an identical root/base name that specifies bounding box coordinates and text content. See #39, #10, and #53.

ustczhouyu commented 5 years ago

Hi mattroos,

I add some layers in both model_cz.prototxt and tiny.prototxt, when I train the model by python train.py, one error occur: valueError: cannot reshape array of size 6204 into shape(22,1,141).This error happens in 260th line in validation.py, that is ctc_f = ctc_f.reshape(ctc_f.shape[0], ctc_f.shape[1], ctc_f.shape[3]). As we know, 6204=2221141, so I want to know than can I change ctc_f = ctc_f.reshape(ctc_f.shape[0], ctc_f.shape[1], ctc_f.shape[3]) to ctc_f = ctc_f.reshape(ctc_f.shape[0], 2ctc_f.shape[1], ctc_f.shape[3]) so that the result is (22,2,141)? Can you help me? Thank you very much.

ustczhouyu commented 5 years ago

They should contain a list of image filenames for training or validation, one per line. The filenames can be full absolute filenames (full path starting with '/') or partial names, relative to the directory in which the list file is stored. Set the -data_dir argument to the same directory name. When training using the detection model you'll also need to specify that directory name in the tiny.prototxt file, for the OnDiskLayer. Only .png and .jpg files can be used. Each image file should have a .txt file with an identical root/base name that specifies bounding box coordinates and text content. See #39, #10, and #53.

Hi mattroos,

I add some layers in both model_cz.prototxt and tiny.prototxt, when I train the model by python train.py, one error occur: valueError: cannot reshape array of size 6204 into shape(22,1,141).This error happens in 260th line in validation.py, that is ctc_f = ctc_f.reshape(ctc_f.shape[0], ctc_f.shape[1], ctc_f.shape[3]). As we know, 6204=2221141, so I want to know than can I change ctc_f = ctc_f.reshape(ctc_f.shape[0], ctc_f.shape[1], ctc_f.shape[3]) to ctc_f = ctc_f.reshape(ctc_f.shape[0], 2ctc_f.shape[1], ctc_f.shape[3]) so that the result is (22,2,141)? Can you help me? Thank you very much.

ustczhouyu commented 5 years ago

Hi mattroos,

I add some layers in both model_cz.prototxt and tiny.prototxt, when I train the model by python train.py, one error occur: valueError: cannot reshape array of size 6204 into shape(22,1,141).This error happens in 260th line in validation.py, that is ctc_f = ctc_f.reshape(ctc_f.shape[0], ctc_f.shape[1], ctc_f.shape[3]). As we know, 6204=2221141, so I want to know than can I change ctc_f = ctc_f.reshape(ctc_f.shape[0], ctc_f.shape[1], ctc_f.shape[3]) to ctc_f = ctc_f.reshape(ctc_f.shape[0], 2ctc_f.shape[1], ctc_f.shape[3]) so that the result is (22,2,141)? Can you help me? Thank you very much.

At 2018-10-23 03:10:51, "mattroos" notifications@github.com wrote:

They should contain a list of image filenames for training or validation, one per line. The filenames can be full absolute filenames (full path starting with '/') or partial names, relative to the directory in which the list file is stored. Set the -data_dir argument to the same directory name. When training using the detection model you'll also need to specify that directory name in the tiny.prototxt file, for the OnDiskLayer. Only .png and .jpg files can be used. Each image file should have a .txt file with an identical root/base name that specifies bounding box coordinates and text content. See #39, #10, and #53.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.