2

This is the sequence I intend to input:

sequence = [[[113, 162, 159], [3, 163, 417], [393, 77, 333], [420, 214, 382], [308, 441, 175], [152, 80, 477], [184, 101, 54], [417, 277, 487], [494, 329, 315], [413, 386, 319]], 
[425, 132, 407], 
[405]]

However, I am unable to determine what shape of placeholder to use for it.

x = tf.placeholder(tf.float32, shape=[None, None, 3], name='probable_solutions')
sess = tf.Session()
init_op = tf.global_variables_initializer()
sess.run(init_op)
sess.run(x, feed_dict={x: [sequence[0], sequence[1], sequence[2]]})

This gives me the following error:

ValueError: setting an array element with a sequence.

Here's the full code- https://pastebin.com/cq44wcir

(I've also marked a few questions in the pastebin code - you can find them by searching for '#~~#', no quotes, in the text)

Ishaan Patel
  • 205
  • 1
  • 12

1 Answers1

1

Collected from :

first of all before sending it to feed_dict, sequence should be a numpy array.

of course, you can convert it to numpy array easily but that's not the solution.

It's clear that you are trying to create an array from a list which isn't shaped like a multi-dimensional array.

Any array which isn't "Generalized" cannot be used as feed_dict

Maruf
  • 792
  • 12
  • 36