reading-text-in-the-wild icon indicating copy to clipboard operation
reading-text-in-the-wild copied to clipboard

data generator error when train charnet

Open Suyuanhang opened this issue 7 years ago • 10 comments

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.

Suyuanhang avatar Mar 23 '17 22:03 Suyuanhang

@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!

mathDR avatar Mar 24 '17 16:03 mathDR

Hi mathDR

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

guddulrk avatar Apr 01 '17 03:04 guddulrk

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

mathDR avatar Apr 01 '17 03:04 mathDR

Hi mathDR,

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

ImportError: cannot import name 'CustomZeroPadding2D'

Any help please..

guddulrk avatar Apr 01 '17 05:04 guddulrk

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

mathDR avatar Apr 01 '17 20:04 mathDR

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 avatar Apr 02 '17 00:04 guddulrk

AssertionError:

guddulrk avatar Apr 02 '17 00:04 guddulrk

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

guddulrk avatar Apr 02 '17 05:04 guddulrk

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

mathDR avatar Apr 02 '17 15:04 mathDR

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

guddulrk avatar Apr 02 '17 23:04 guddulrk