0
我想用數組提供MLP。輸入數組包含120個浮標和輸出包含2TensorFlow MLP不可互換類型'列表'
sess.run(init)
# Training cycle
train = True
if train is True:
for i in range(50):
for letter in d1:
#print(letter[0][0][0:5])
letter[0][0][0:5] = sorted(letter[0][0][0:5], key=itemgetter(0))
letter[0][0][5:10] = sorted(letter[0][0][5:10], key=itemgetter(0))
#print(np.squeeze(np.asarray(d1[0])))
result=[]
for x in letter[0][0]:
for y in x:
result.append(y)
div = (result)
xxx = [letter[0][1][0], int(not letter[0][1][0])]
xxx = (xxx)
print(result)
#print(letter[1])
_, c = sess.run([optimizer, cost], feed_dict={x: div, y: xxx})
執行的最後一行當拋出異常:
Traceback (most recent call last):
File "tf.py", line 97, in <module>
_, c = sess.run([optimizer, cost], feed_dict={x: div, y: xxx})
TypeError: unhashable type: 'list'