在Keras中嵌入函数不适用于浮动16

2024-04-26 17:22:29 发布

您现在位置:Python中文网/ 问答频道 /正文

运行imdb时_第一季度从keras示例 (代码可在此处找到) https://gist.github.com/raghavgurbaxani/20c08c55eca5e97cd5c51389c091fc9f

我知道错误了

tensorflow.python.framework.errors_impl.InvalidArgumentError:   indices[14,25] = 20000 is not in [0, 20000)
[[Node: embedding_1/GatherV2 = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_HALF,
_class=["loc:@training/Adam/gradients/embedding_1/GatherV2_grad/Reshape"],
_device="/job:localhost/replica:0/task:0/device:CPU:0"](embedding_1/embeddings/read, embedding_1/Cast, lstm_1/TensorArrayUnstack/range/start)]]

Caused by op u`embedding_1/GatherV2`, defined at:

是的tf.聚集不支持浮动16?在

(在泰坦X上使用tensorflow 1.8.0、keras 2.2.0)

谢谢:)


Tags: 代码httpsgithubcom示例devicetensorflowdt