qjadud1994 / CRNN-Keras

CRNN (CNN+RNN) for OCR using Keras / License Plate Recognition
MIT License
527 stars 191 forks source link

LSTM Layer #48

Open Grayfados opened 4 years ago

Grayfados commented 4 years ago

Hi there, I'm getting some problems when I try to run the code. I changed the data set to a same type of the original input but I can't pass this far...

Some one could help me?

RNN layer

lstm_1 = LSTM(256, return_sequences=True, kernel_initializer='he_normal', name='lstm1')(inner)  # (None, 32, 512)
lstm_1b = LSTM(256, return_sequences=True, go_backwards=True, kernel_initializer='he_normal', name='lstm1_b') (inner)
reversed_lstm_1b = Lambda(lambda inputTensor: K.reverse(inputTensor, axes=1)) (lstm_1b)

Exception has occurred: TypeError Expected Operation, Variable, or Tensor, got 0 File "\CRNN-Keras-master\Model.py", line 62, in get_Model lstm_1 = LSTM(256, return_sequences=True, kernel_initializer='he_normal', name='lstm1')(inner) # (None, 32, 512) File "\CRNN-Keras-master\training.py", line 11, in model = get_Model(training=True)

tikhonovpavel commented 4 years ago

@Grayfados, have you solved the issue? I've got the same

zabir-nabil commented 4 years ago

In Model.py replace the imports with following

from tensorflow.python.keras import backend as K
from tensorflow.python.keras.layers import Conv2D, MaxPooling2D
from tensorflow.python.keras.layers import Input, Dense, Activation
from tensorflow.python.keras.layers import Reshape, Lambda, BatchNormalization
from tensorflow.python.keras.layers.merge import add, concatenate
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.layers import LSTM