You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The codes run fine with the provided embeddings. But when I delete the embeddings in the models directory and retrain it. I get the following errors:
trainGraph.py:127: UserWarning: Update your Conv1D call to the Keras 2 API: Conv1D(activation="relu", padding="valid", strides=1, filters=3, kernel_size=3)
subsample_length=1)(graph_in)
trainGraph.py:128: UserWarning: Update your MaxPooling1D call to the Keras 2 API: MaxPooling1D(pool_size=2)
pool = MaxPooling1D(pool_length=2)(conv)
trainGraph.py:127: UserWarning: Update your Conv1D call to the Keras 2 API: Conv1D(activation="relu", padding="valid", strides=1, filters=3, kernel_size=4)
subsample_length=1)(graph_in)
trainGraph.py:133: UserWarning: The Merge layer is deprecated and will be removed after 08/2017. Use instead layers from keras.layers.merge, e.g. add, concatenate, etc.
out = Merge(mode='concat')(convs)
trainGraph.py:137: UserWarning: Update your Model call to the Keras 2 API: Model(outputs=Join.0, inputs=/input_1)
graph = Model(input=graph_in, output=out)
/root/anaconda/lib/python2.7/site-packages/keras/models.py:849: UserWarning: The nb_epoch argument in fit has been renamed epochs.
warnings.warn('The nb_epoch argument in fit '
Traceback (most recent call last):
File "trainGraph.py", line 158, in
model.fit(x_shuffled, y_shuffled, batch_size=batch_size, nb_epoch=num_epochs, validation_split=val_split, verbose=2)
File "/root/anaconda/lib/python2.7/site-packages/keras/models.py", line 868, in fit
initial_epoch=initial_epoch)
File "/root/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 1434, in fit
batch_size=batch_size)
File "/root/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 1310, in _standardize_user_data
exception_prefix='input')
File "/root/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 139, in _standardize_input_data
str(array.shape))
ValueError: Error when checking input: expected embedding_1_input to have shape (None, 56) but got array with shape (481625, 629)
Any idea to fix it? Thanks.
The text was updated successfully, but these errors were encountered:
I am short of time these days. Current recommendation is to update old code for recent Keras and verify array dimensionality it produces to match the provided embeddings. The error here:
ValueError: Error when checking input: expected embedding_1_input to have shape (None, 56) but got array with shape (481625, 629)
I am getting this error: File "trainGraph.py", line 131, in
conv = Conv1D(filters=num_filters, kernerl_size=fsz, padding='valid', activation='relu', strides=1)(graph_in)
TypeError: init() takes at least 3 arguments (2 given)
Hi, I have reverted to an earlier commit: https://github.com/alexander-rakhlin/CNN-for-Sentence-Classification-in-Keras/tree/0a10445fbd0a1c783e6231cd1accb1e1a4e2252f
The codes run fine with the provided embeddings. But when I delete the embeddings in the models directory and retrain it. I get the following errors:
trainGraph.py:127: UserWarning: Update your
Conv1D
call to the Keras 2 API:Conv1D(activation="relu", padding="valid", strides=1, filters=3, kernel_size=3)
subsample_length=1)(graph_in)
trainGraph.py:128: UserWarning: Update your
MaxPooling1D
call to the Keras 2 API:MaxPooling1D(pool_size=2)
pool = MaxPooling1D(pool_length=2)(conv)
trainGraph.py:127: UserWarning: Update your
Conv1D
call to the Keras 2 API:Conv1D(activation="relu", padding="valid", strides=1, filters=3, kernel_size=4)
subsample_length=1)(graph_in)
trainGraph.py:133: UserWarning: The
Merge
layer is deprecated and will be removed after 08/2017. Use instead layers fromkeras.layers.merge
, e.g.add
,concatenate
, etc.out = Merge(mode='concat')(convs)
trainGraph.py:137: UserWarning: Update your
Model
call to the Keras 2 API:Model(outputs=Join.0, inputs=/input_1)
graph = Model(input=graph_in, output=out)
/root/anaconda/lib/python2.7/site-packages/keras/models.py:849: UserWarning: The
nb_epoch
argument infit
has been renamedepochs
.warnings.warn('The
nb_epoch
argument infit
'Traceback (most recent call last):
File "trainGraph.py", line 158, in
model.fit(x_shuffled, y_shuffled, batch_size=batch_size, nb_epoch=num_epochs, validation_split=val_split, verbose=2)
File "/root/anaconda/lib/python2.7/site-packages/keras/models.py", line 868, in fit
initial_epoch=initial_epoch)
File "/root/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 1434, in fit
batch_size=batch_size)
File "/root/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 1310, in _standardize_user_data
exception_prefix='input')
File "/root/anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 139, in _standardize_input_data
str(array.shape))
ValueError: Error when checking input: expected embedding_1_input to have shape (None, 56) but got array with shape (481625, 629)
Any idea to fix it? Thanks.
The text was updated successfully, but these errors were encountered: