nicolas-ivanov / debug_seq2seq

[unmaintained] Make seq2seq for keras work
233 stars 86 forks source link

recurrentcontainer_2 shape mismatch #17

Open akhavr opened 8 years ago

akhavr commented 8 years ago

Tried to reproduce your results, but fail. After doing minor fixes re changed case, etc, I get:

INFO:lib.nn_model.train:Full-data-pass iteration num: 1
/home/akhavr/src/seq2seq/.env/local/lib/python2.7/site-packages/keras/models.py:610: UserWarning: The "show_accuracy" argument is deprecated, instead you should pass the "accuracy" metric to the model at compile time:
`model.compile(optimizer, loss, metrics=["accuracy"])`
  warnings.warn('The "show_accuracy" argument is deprecated, '
Traceback (most recent call last):
  File "bin/train.py", line 37, in <module>
    learn()
  File "bin/train.py", line 33, in learn
    train_model(nn_model, w2v_model, dialog_lines_for_nn, index_to_token)
  File "/home/akhavr/src/seq2seq/debug_seq2seq/lib/nn_model/train.py", line 87, in train_model
    nn_model.fit(X_train, Y_train, batch_size=TRAIN_BATCH_SIZE, nb_epoch=1, show_accuracy=True, verbose=1)
  File "/home/akhavr/src/seq2seq/.env/local/lib/python2.7/site-packages/keras/models.py", line 627, in fit
    sample_weight=sample_weight)
  File "/home/akhavr/src/seq2seq/.env/local/lib/python2.7/site-packages/keras/engine/training.py", line 1052, in fit
    batch_size=batch_size)
  File "/home/akhavr/src/seq2seq/.env/local/lib/python2.7/site-packages/keras/engine/training.py", line 983, in _standardize_user_data
    exception_prefix='model target')
  File "/home/akhavr/src/seq2seq/.env/local/lib/python2.7/site-packages/keras/engine/training.py", line 111, in standardize_input_data
    str(array.shape))
Exception: Error when checking model target: expected recurrentcontainer_2 to have shape (None, 6, 512) but got array with shape (32, 6, 20001)

What I'm doing wrong?

farizrahman4u commented 8 years ago

Shape of your model is not compatible with your training data.

akhavr commented 8 years ago

I know what that message means. I opened the issue, because this happens out of the box. Does it still works for you?

If interested, I'll upload my changes to a fork.

dmartincc commented 8 years ago

@akhavr Could you post how you solved this issue?

akhavr commented 8 years ago

@dmartincc I didn't, I've moved on instead