TheAILearner / A-CRNN-model-for-Text-Recognition-in-Keras

64 stars 33 forks source link

ValueError: Error when checking input: expected input_4 to have 4 dimensions, but got array with shape (3, 1) #16

Open abhinavgola opened 4 years ago

abhinavgola commented 4 years ago

ValueError Traceback (most recent call last) in () 1 batch_size = 256 2 epochs = 1 ----> 3 model.fit(x=[training_img, train_padded_txt, train_input_length, train_label_length], y=np.zeros(len(training_img)), batch_size=batch_size, epochs = epochs, validation_data = ([valid_img, valid_padded_txt, valid_input_length, valid_label_length], [np.zeros(len(valid_img))]), verbose = 1, callbacks = callbacks_list)

2 frames /usr/local/lib/python3.6/dist-packages/keras/engine/training_utils.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix) 133 ': expected ' + names[i] + ' to have ' + 134 str(len(shape)) + ' dimensions, but got array ' --> 135 'with shape ' + str(data_shape)) 136 if not check_batch_axis: 137 data_shape = data_shape[1:]

Any reason why this error is occurring and how to solve it?