1 Answers1

0

List of errors

Error 1:

TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.

From: x = tf.split(0, n_chunks, x)
To: x = tf.split(axis=0, num_or_size_splits=n_chunks, value=x)

Error 2:

AttributeError: module 'tensorflow.contrib.rnn.python.ops.rnn_cell' has no attribute 'BasicLSTMCell'

From:
from tensorflow.contrib.rnn.python.ops import rnn_cell lstm_cell = rnn_cell.BasicLSTMCell(rnn_size,state_is_tuple=True)
To:
from tensorflow.contrib.rnn import BasicLSTMCell lstm_cell = BasicLSTMCell(rnn_size,state_is_tuple=True)

Error 3:

NameError: name 'rnn' is not defined

From: outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32)
To: outputs, states = tf.nn.dynamic_rnn(cell=lstm_cell, inputs=x, dtype=tf.float32)

Error 4:

ValueError: Dimension must be 2 but is 3 for 'transpose_3' (op: 'Transpose') with input shapes: [?,28], [3].

Comment:
x = tf.transpose(x, [1,0,2]) x = tf.reshape(x, [-1, chunk_size]) x = tf.split(axis=0, num_or_size_splits=n_chunks, value=x)

Error 5:

ValueError: Only call softmax_cross_entropy_with_logits with named arguments (labels=..., logits=..., ...)

From:
cost = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits(prediction,y) )
To:
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=prediction,labels=y))

Error 6:

InvalidArgumentError: logits and labels must be same size: logits_size=[28,10] labels_size=[128,10]

That's a maybe concept problem with the softmax_cross_entropy_with_logits function. Take a look at: softmax_cross_entropy_with_logits and doc

Start understanding and fixing all these problems. If you still aren't able to run the code, come back and post the updated code, but, at least, with that 6 problems solved :)

Alber8295
  • 763
  • 1
  • 8
  • 19