【发布时间】:2018-02-19 15:20:10
【问题描述】:
def greedy_decoder(input):
flag = 0
prob = 1
ans_partial = np.zeros((1,maxlen_input))
ans_partial[0, -1] = 2 # the index of the symbol BOS (begin of sentence)
for k in range(maxlen_input - 1):
ye = model.predict([input, ans_partial])
yel = ye[0,:]
p = np.max(yel)
mp = np.argmax(ye)
尝试运行此代码时会弹出此错误
yel = ye[0,:]
TypeError: list indices must be integers or slices, not tuple
知道如何解决这个问题吗?我正在使用 python 3.6 谢谢
【问题讨论】:
标签: python python-3.x keras