jonny-d / Tensorflow_mLSTM

Train an mLSTM language model in Tensorflow
20 stars 5 forks source link

ValueError: all the input arrays must have same number of dimensions #3

Open jozi opened 7 years ago

jozi commented 7 years ago

get this error when run extract_weights.py in line 97 : b = np.concatenate((Wib,Wfb,Wob,Whb), axis=1)

ValueError: all the input arrays must have same number of dimensions

jozi commented 7 years ago

you change train_mLSTM.py in this line - Wmb = tf.Variable(tf.zeros([1, rnn_size]),name = 'Wmb')

jonny-d commented 7 years ago

Hello @jozi !

Thank you for pointing this out. I have updated the extract_weights.py script to work with the train_mLSTM.py script as it is now.

The Wmb variable was redundant in the older version of the train_mLSTM.py script, it was defined (by accident) but never actually used, and because the variables in weights_list are listed in the order in which they are defined in train_mLSTM.py, this is what caused the problem.

Hope this helps!