文本(方便查找):InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: indices[0,0] = 3479 is not in [0, 1785) [[node sequential/embedding/embedding_lookup (defined at <ipython-input-15-f68b96d3c625>:7) ]] [[sequential/embedding/embedding_lookup/_24]] (1) Invalid argument: indices[0,0] = 3479 is not in [0, 1785) [[node sequential/embedding/embedding_lookup (defined at <ipython-input-15-f68b96d3c625>:7) ]] 0 successful operations. 0 derived errors ignored. [Op:__inference_train_function_4487] Errors may have originated from an input operation. Input Source operations connected to node sequential/embedding/embedding_lookup: sequential/embedding/embedding_lookup/2796 (defined at /usr/lib/python3.7/contextlib.py:112) Input Source operations connected to node sequential/embedding/embedding_lookup: sequential/embedding/embedding_lookup/2796 (defined at /usr/lib/python3.7/contextlib.py:112) Function call stack: train_function -> train_function
问题翻译:InvalidArgumentError:找到2个根错误。 (0)无效参数:indexs [0,0] = 3479不在[0,1785中] [[节点顺序/嵌入/嵌入_查找(在<ipython-input-15-f68b96d3c625>:7处定义)]]] [[顺序 / embedding / embedding_lookup / _24]](1)无效的参数:indexs [0,0] = 3479不在[0,1785中] [[节点顺序/ embeddding / embedding_lookup(定义在<ipython-input-15-f68b96d3c625> :7)]] 0成功操作。 忽略0个派生错误。 [Op:__ inference_train_function_4487]错误可能是由于输入操作引起的。 输入源操作连接到节点sequential / embeddding / embedding_lookup:顺序/ embeddding / embedding_lookup / 2796(在/usr/lib/python3.7/contextlib.py:112上定义)输入源操作连接到节点sequence / embeddding / embedding_lookup:顺序 / embedding / embedding_lookup / 2796(在/usr/lib/python3.7/contextlib.py:112中定义)函数调用堆栈:train_function-> train_function
问题分析:
[0.1785]这个问题可以看出是词表的问题,我的chinese vocabulary size: 1784,English vocabulary size: 5232,所以词表大小要加到最大的那一个,修改代码为:english_vocab_size+1, chinese_vocab_size+3450