解决tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,32] = -1 is not in [0, 50)

Posted 沉迷单车的追风少年

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,32] = -1 is not in [0, 50)相关的知识,希望对你有一定的参考价值。

今晚遇到了一个很神奇的问题,在tensorflow embedding过程中:

 File "/root/Handwriting/Diffusion-Handwriting-Generation-master/nn.py", line 215, in call
    output = self.embedding(lstm_output)
  File "/root/anaconda3/envs/tf35/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 985, in __call__
    outputs = call_fn(inputs, *args, **kwargs)
  File "/root/anaconda3/envs/tf35/lib/python3.7/site-packages/tensorflow/python/keras/layers/embeddings.py", line 189, in call
    out = embedding_ops.embedding_lookup_v2(self.embeddings, inputs)
  File "/root/anaconda3/envs/tf35/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py", line 201, in wrapper
    return target(*args, **kwargs)
  File "/root/anaconda3/envs/tf35/lib/python3.7/site-packages/tensorflow/python/ops/embedding_ops.py", line 394, in embedding_lookup_v2
    return embedding_lookup(params, ids, "div", name, max_norm=max

以上是关于解决tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,32] = -1 is not in [0, 50)的主要内容,如果未能解决你的问题,请参考以下文章

云原生景观:可观察性和分析解决了什么问题?如何解决的?

vs2008解决方案资源管理器不显示解决方案

什么是 沙盒解决方案

解决PowerShell乱码问题

如何解决解决方案中现有项目的c#CS0006错误

关于问题解决与事件解决的思考