keras嵌入层导致tensorflow.python.framework.errors_impl.InvalidArgumentError:

时间:2019-07-08 11:50:39

标签: python-3.x tensorflow keras embedding

这是完整的堆栈

Traceback (most recent call last):
  File "main.py", line 238, in <module>
    nnmodel.cnn(algo='cnnsubfeats')
  File "scripts.py", line 183, in cnn
    validation_split=vs
  File "/opt/anaconda3/envs/oea/lib/python3.6/site-packages/keras/engine/training.py", line 1039, in fit
    validation_steps=validation_steps)
  File "/opt/anaconda3/envs/oea/lib/python3.6/site-packages/keras/engine/training_arrays.py", line 199, in fit_loop
    outs = f(ins_batch)
  File "/opt/anaconda3/envs/oea/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2715, in __call__
    return self._call(inputs)
  File "/opt/anaconda3/envs/oea/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2675, in _call
    fetched = self._callable_fn(*array_vals)
  File "/opt/anaconda3/envs/oea/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1439, in __call__
    run_metadata_ptr)
  File "/opt/anaconda3/envs/oea/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[130,3006] = 22349 is not in [0, 12133)
         [[{{node embedding_1/embedding_lookup}} = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@training/Adam/Assign_2"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](embedding_1/embeddings/read, embedding_1/Cast, training/Adam/gradients/embedding_1/embedding_lookup_grad/concat/axis)]]

我尝试扩展词汇量,但是出现了同样的错误!

0 个答案:

没有答案