jonrein / tensorflow_CTC_example

A short example of training a bidirectional LSTM model with connectionist temporal classification
154 stars 52 forks source link

test #6

Open Yang507 opened 7 years ago

Yang507 commented 7 years ago

hello, I train my data with your code with successful,but I meet a problem for i cannot how to use the model to train my data,thanks!

jonrein commented 7 years ago

The main purpose of the code is to give an example implementation of LSTM and CTC in TensorFlow. I'd expect any individualized application to require some parameter tuning and almost certainly more than one layer. If you can provide some more detail on what you're trying to do and what you're having problems with, I may be able to offer some suggestions.

Yang507 commented 7 years ago

I tried to use LSTM and CTC to identity my ID card numbers like captcha,I generated some data with label and use your data format, I used your frame to train my generating data well and get the precision about 90.6 ,now I have some real images with no label, I don't want to recognition my character one by one, now I don't know how to test. Thank your reply!

jonrein commented 7 years ago

Sorry, but I'm confused by this part: "I don't want to recognition my character one by one". Are you saying that you want some output format other than a sequence of characters?

Yang507 commented 7 years ago

oh,I'm sorry ,I confused you the problem. In fact, I want to recognition for the whole sequence with LSTM

jonrein commented 7 years ago

I'm still not following. What exactly are you trying to do that isn't working with the current code?

Yang507 commented 7 years ago

I just don'know how to test my unlabeled data ,to change my data become the format like "npy"?

jonrein commented 7 years ago

If you're just looking for the model's predictions for new inputs, you'd have a line like pred = session.run([predictions], feed_dict={inputX: new_inputs) If you're trying to evaluate the accuracy of the model against a test set, you'll have to label it. I suppose you can have it in any format you'd like if you want to implement a different evaluation function, but the error rate calculation in the TensorFlow graph definitely assumes a particular format.

Yang507 commented 7 years ago

thanks your reply!I don't understand the code nFeatures = 26 #12 MFCC coefficients + energy, and derivativesin bdlstm_train.py, my classifications are 11.

Yang507 commented 7 years ago

i don't know whether you wrote a test code, i have no way to deal with it

jonrein commented 7 years ago

Regarding the line nFeatures = 26 #12 MFCC coefficients + energy, and derivatives, nFeatures is the number of features/dimensions of your input data. The example code uses 26 Mel-frequency cepstral coefficients, which is a common input representation for speech recognition. For character recognition in handwriting or captcha, you'd probably set nFeatures to the number of rows in the image, unless you'd done some pre-processing on the image that resulted in a different number of features.

I haven't written test code for this toy example. Contributions welcome.

joyJZhang commented 7 years ago

@Yang507 hello,how many training samples do you have?I trained captchas,but the accuracy is very low.

Yang507 commented 7 years ago

@joyJZhang I used over 36W samples to train and the accuracy is reached to 90.6%, do you write the test code? I want to test my data.

joyJZhang commented 7 years ago

Haven't written,My accuracy is too low ,when it improve,I will try to write the test code