mathDR / reading-text-in-the-wild

A Keras/Theano implementation of "Reading Text in the Wild with Convolutional Neural Networks" by M Jaderberg et.al.
GNU General Public License v3.0
116 stars 30 forks source link

data generator error when train charnet #13

Open Suyuanhang opened 7 years ago

Suyuanhang commented 7 years ago

I'm trying to train the charnet using your code

However, keras will throw an error ("tuple expected, but get None") if datagen.flow is fed into model.fit_generator (line 43 in train_charnet.py)

I then use datagen._flow_index, but got another error from fit_generator:

assert len(X)==len(Y)==len(sampleweight)

the problem arises from the returned value of _flow_index is not data but data_index and two other index related parameter, namely "current_index" and "current_batchsize"

Have you tried your program before releasing the code? the Keras fit_generator function expects returned tuple within an infinite loop, otherwise it is wrong.

mathDR commented 7 years ago

@Suyuanhang The training was never "implemented". I was in the process of trying to train on a NVIDIA Jetson TK1 and never got the time to complete it.

That said, can you run the models from the matlab stored networks? If you would like to fix the training code and submit a PR, that would be fantastic!

guddulrk commented 7 years ago

Hi mathDR

I am getting 'No module named .common' error as: from common import _FLOATX, _EPSILON How can I fix it?

mathDR commented 7 years ago

@guddulrk common is a module that is part of keras and should have been installed when you installed keras.

guddulrk commented 7 years ago

Hi mathDR,

I am getting following error even though I have followed instructions correctly.

ImportError: cannot import name 'CustomZeroPadding2D'

Any help please..

mathDR commented 7 years ago

@guddulrk What version of keras and theano are you using? Also, did you update keras and theano with the respective classes?

guddulrk commented 7 years ago

Thank you so much mathDR. I solved that problem. I am running your program on CPU and getting following error:

ssertionError: AbstractConv2d Theano optimization failed: there is no implementation available supporting the requested options. Did you exclude both "conv_dnn" and "conv_gemm" from the optimizer? If on GPU, is cuDNN available and does the GPU support it? If on CPU, do you have a BLAS library installed Theano can link against?

Can I run this application on CPU?

guddulrk commented 7 years ago

AssertionError:

guddulrk commented 7 years ago

Dear mathDR, Finally I resolved all the errors. Actually I am using python 3.5 on CPU. Therefore, getting a lot of issues (I think so). Would you please guide me, from where can I download "annotation_train.txt", "annotation_test.txt" and "annotation_val.txt" files?

Thanks for your help

mathDR commented 7 years ago

@guddulrk It has been a while, but I am confident those data files come from the MJSynth datasets

guddulrk commented 7 years ago

Dear mathDR, thank you so much for your help. I have found those files.