TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.

Table of Contents

tensorflow

word embedding

代码:

      1. loss = tf.reduce_mean(

  2.   tf.nn.nce_loss(nce_weights, nce_biases, embed, train_labels,

  3.                  num_sampled, vocabulary_size))

报错:

TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.

解决办法:

loss = tf.reduce_mean(
tf.nn.nce_loss(nce_weights, nce_biases, train_labels,embed,
num_sampled, vocabulary_size))

0 评论

发表评论

精品游戏◆乐于分享


Title