LouisScorpio / datamining

learn in datamining
522 stars 848 forks source link

word2vec code not work #6

Open Prayforhanluo opened 7 years ago

Prayforhanluo commented 7 years ago

训练的时候,报错: Input 'y' of 'Mul' Op has type float32 that does not match type int32 of argument 'x'.

关于这行代码:loss=tf.reduce_mean(tf.nn.nce_loss(nce_weights, nce_bias, embed, train_labels, num_sampled, num_classes=vocabulary_size))

我想是tensorflow的版本问题还是什么原因?

LouisScorpio commented 7 years ago

@Prayforhanluo 版本是0.12 不知道你是不是用的我给的数据集,报错提示在进行操作时,输入和设定的数据类型不一致,一个是int32一个是float32,可以跟一下代码看看

Prayforhanluo commented 7 years ago

@LouisScorpio tensorflow的版本原因 换成一致的版本可以运行