我试图按照此博客文章中的说明运行代码。
但是收到此错误...
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
这是我实际使用的代码:
https://github.com/shantanuo/pandas_examples/blob/master/tensorflow/factoid_using_bAbI.ipynb
作者正在尝试为答案词索引创建标签1。但是我想语法是错误的。我应该如何纠正此功能?
更新: 本文基于官方的keras示例,该示例在我尝试时按预期工作。但是本文中提到的代码不起作用。
https://github.com/keras-team/keras/blob/master/examples/babi_rnn.py