text-cnn
text-cnn copied to clipboard
运行train_word2vec.py和text_train.py的时候出问题
您好,gaussic的那个我之前有运行过。之后一直在找基于Word2vec训练的词向量嵌入CNN后的模型训练。有幸发现您的项目。 不过 我在使用THUCNews文本运行train_word2vec.py的时候会提示 RuntimeError: you must first build vocabulary before training the model 后下载了您训练好的vector_word.txt,运行text_train.py的时候会提示 ValueError: zero-size array to reduction operation maximum which has no identity。 想请问下您,以上问题要怎样解决呢?
我也运行出了这个错误,楼主找到解决方法了吗?
ValueError: zero-size array to reduction operation maximum which has no identity。
问题已经解决
修改loader.py的107行
#y_pad=kr.utils.to_categorical(label_id)
修改为
y_pad = kr.utils.to_categorical(label_id, num_classes=len(cat_to_id))