manishperiwal2009 / Generating-Sentences-VAE-LSTM

8 stars 5 forks source link

i can't run it correctly #1

Open tuanshanyou opened 7 years ago

tuanshanyou commented 7 years ago

the structure is complicated。 it makes a lot of unexpected mistakes...

manishperiwal2009 commented 7 years ago

@tuanshanyou - Please tell me the problem/error you are facing exactly? Though I was thinking to write down the explaination of the code.

tuanshanyou commented 7 years ago

Thank you for your reply. its requirements include python 3.5,but it has some grammar which is delete or modify in 3.5 such as "xrange and reload(sys)" so i use python2.7 to try it .

then the question is " Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32." in model.py"encoder_inputs_split = tf.split(0, self.args.num_steps, XR)" I exchanged 1 and 2 position to solve it .(it is tensorflow1.0's grammar)

then the question i meet is "cannot import name rnn_cell". it shold be the version problem of tensorflow. in tensorflow1.0(which i use now ) ,it may be "tf.contrib.rnn.core_rnn_cell",not " tensorflow.models.rnn.rnn_cell". i change it into "from tensorflow.contrib import rnn ,rnn.BasicLSTMCell /n rnn.LSTMCell(...)...".and change "tf.nn.rnn(cell, encoder_inputs_split, dtype=tf.float32)" into "tf.nn.dynamic_rnn(cell, encoder_inputs_split, dtype=tf.float32)".the former works but th later lacks a parameter. then I decided to put it aside for the time being..

manishperiwal2009 commented 7 years ago

Thanks @tuanshanyou for pointing it out. The code was written with tensorflow v0.12. I will update the code to tensorflow v1.0.