Belval / CRNN

A TensorFlow implementation of https://github.com/bgshih/crnn
MIT License
299 stars 101 forks source link

Questions about the graph #5

Closed Mendel1 closed 6 years ago

Mendel1 commented 6 years ago

I have a little question about this part below. Does this mean you slice it along first axis, which means you slice it along batch-size dimension? But according to the paper,shouldn't it be sliced along 'w' dimension?

        def MapToSequences(x):
            x = tf.squeeze(x, [1])
            x = tf.unstack(x)
            return x
Belval commented 6 years ago

Using the index 1 means that I squeeze the second dimension.

tf.squeeze only removes "useless" dimensions. In this particular case:

Let batch_size = 64, cnn_out_width = 36 (example), and char_count = 69

The function CNN() will output a tensor of size (64, 1, 36, 69). tf.squeeze(x, [1]) makes it (64, 36, 69).

Can you tell me which page of the paper mentions the map_to_sequence part?

ajiaxiaoyi commented 6 years ago

I got a problem,InvalidArgumentError (see above for traceback): sequence_length(0) <= 31. Can you give me some advice?thanks a lot.

Belval commented 6 years ago

It's bugging me too. I know a workaround but the network still won't correct train.

Basically, the BLSTM returns 31 time steps so the seq_lens are automatically 31 max.

I'll push a fix later today.

ajiaxiaoyi commented 6 years ago

Okay,thanks.

TCcoder commented 6 years ago

i have the same problem, have you solved it? @Belval @ajiaxiaoyi

Belval commented 6 years ago

The sequence length issue is solved in origin/remove-ctc but it does not converge as of today.

TCcoder commented 6 years ago

er.. what you mean is the network still won't correct train. what should i do with my code? thanks a lot.

Belval commented 6 years ago

You can converge on small dataset with short words (it could read about a 100) but indeed it is not close to the paper performance-wise.

TCcoder commented 6 years ago

i see,and i will try again,thank you very much.

Belval commented 6 years ago

The sequence length error was related to an error in the CNN part of the network. Please retry with current master.