snakeztc / NeuralDialog-CVAE

Tensorflow Implementation of Knowledge-Guided CVAE for dialog generation ACL 2017. It is released by Tiancheng Zhao (Tony) from Dialog Research Center, LTI, CMU

Home Page:https://www.cs.cmu.edu/~tianchez/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LSTM doesn't work

dimeldo opened this issue · comments

Changing the cell type to LSTM throws an error (with default parameters and code):

ValueError: Shape must be rank 2 but is rank 3 for 'model/concat' (op: 'ConcatV2') with input shapes: [?,30], [?,4], [?,4], [2,?,600], [].

Thanks for the heads up. I pushed the fixed solution. Closing issue.

After using your fix I get this error:

Traceback (most recent call last):
  File "kgcvae_swda.py", line 172, in <module>
    main()
  File "kgcvae_swda.py", line 72, in main
    model = KgRnnCVAE(sess, config, api, log_dir=None if FLAGS.forward_only else log_dir, forward=False, scope=scope)
  File "/Downloads/NeuralDialog-CVAE/models/cvae.py", line 243, in __init__
    input_embedding = tf.reshape(input_embedding, [-1, max_dialog_len, sent_size])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 3938, in reshape
    "Reshape", tensor=tensor, shape=shape, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 528, in _apply_op_helper
    (input_name, err))
ValueError: Tried to convert 'shape' to a tensor and failed. Error: Shapes must be equal rank, but are 0 and 1
	From merging shape 1 with other shapes. for 'model/wordEmbedding/Reshape_2/packed' (op: 'Pack') with input shapes: [], [], [4].

How can I solve this error?