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

来源:互联网 发布:申请域名 编辑:程序博客网 时间:2024/05/16 07:29

tensorflow 

word embedding

代码:

loss = tf.reduce_mean(  tf.nn.nce_loss(nce_weights, nce_biases, embed, train_labels,                 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 0
原创粉丝点击