julianser/hed-dlg-truncated

error running chat

Closed this issue · 2 comments

Working with commit 3bf6667 and a model given to me by Julian:

THEANO_FLAGS=mode=FAST_RUN,floatX=float32,allow_gc=True,scan.allow_gc=False,nvcc.flags=-use_fast_math python chat.py ../models/1440081670.06_MovieScriptModel__30001
Using gpu device 0: GeForce GTX TITAN
2015-09-09 20:09:51,887: model: DEBUG: idim: 20001
2015-09-09 20:09:51,887: model: DEBUG: Initializing Theano variables
2015-09-09 20:09:51,937: model: DEBUG: Decoder bias type all
2015-09-09 20:09:54,253: model: DEBUG: Initializing forward utterance encoder
2015-09-09 20:09:55,158: model: DEBUG: Build forward utterance encoder
2015-09-09 20:09:55,216: model: DEBUG: Initializing backward utterance encoder
2015-09-09 20:09:55,971: model: DEBUG: Build backward utterance encoder
2015-09-09 20:09:56,012: model: DEBUG: Initializing dialog encoder
2015-09-09 20:09:59,080: model: DEBUG: Build dialog encoder
2015-09-09 20:09:59,131: model: DEBUG: Initializing decoder
2015-09-09 20:10:03,578: model: DEBUG: Initializing dialog dummy encoder
2015-09-09 20:10:03,817: model: DEBUG: Build dialog dummy encoder
2015-09-09 20:10:03,827: model: DEBUG: Build decoder (NCE) with direct connection from encoder(s)
2015-09-09 20:10:03,910: model: DEBUG: Build decoder (EVAL) with direct connection from encoder(s)
2015-09-09 20:10:09,444: model: DEBUG: Will train all word embeddings
2015-09-09 20:10:09,760: main: DEBUG: Loading previous model
2015-09-09 20:10:09,770: model: DEBUG: Loading W_emb of (20001, 500)
2015-09-09 20:10:09,929: model: DEBUG: Loading W_infwd of (500, 512)
Traceback (most recent call last):
File "chat.py", line 143, in
main()
File "chat.py", line 97, in main
model.load(model_path)
File "/home/cohend/nn_dialog/hed-dlg-truncated/model.py", line 28, in load
raise Exception('Shape mismatch: {} != {} for {}'.format(p.get_value().shape, vals[p.name].shape, p.name))
Exception: Shape mismatch: (500, 512) != (500, 4000) for W_infwd

Traceback (most recent call last):
File "train.py", line 533, in
main(args)
File "train.py", line 250, in main
samples, costs = random_sampler.sample([[]], n_samples=1, n_turns=3)
File "/Users/fengwei/Downloads/projectCode/hed-dlg-truncated-cn-python3/search.py", line 56, in sample_apply
samples, costs = sample_logic(sampler, joined_context, **kwargs)
File "/Users/fengwei/Downloads/projectCode/hed-dlg-truncated-cn-python3/search.py", line 157, in sample
new_hd = self.compute_decoder_encoding(enlarged_context, enlarged_reversed_context, self.max_len, zero_mask, zero_mask, numpy.zeros((self.model.bs), dtype='float32'), ran_vector, ones_mask)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/theano/compile/function_module.py", line 795, in call
allow_downcast=s.allow_downcast)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/theano/tensor/type.py", line 178, in filter
data.shape))
TypeError: Bad input argument to theano function with name "decoder_encoding_fn" at index 4 (0-based).
Backtrace when that variable is created:

File "train.py", line 533, in
main(args)
File "train.py", line 158, in main
model = DialogEncoderDecoder(state)
File "/Users/fengwei/Downloads/projectCode/hed-dlg-truncated-cn-python3/dialog_encdec.py", line 1653, in init
self.x_reset_mask = T.vector('reset_mask')
Wrong number of dimensions: expected 1, got 2 with shape (1, 5).

when setting
state['initialize_from_pretrained_word_embeddings'] = True
state['pretrained_word_embeddings_file'] = './Prepare_Data_CN/corpus_words_embedding/Word2Vec_WordEmb.pkl'
state['fix_pretrained_word_embeddings'] = True

could you please help me?

We don't support the chat functionality anymore...