brightmart / ai_law

all kinds of baseline models for long text classificaiton( text categorization)
280 stars 77 forks source link

AttributeError: 'EuclideanKeyedVectors' object has no attribute 'vectors' #3

Closed tangdouer closed 6 years ago

tangdouer commented 6 years ago

('using pre-trained word emebedding.started.word2vec_model_path:', 'data/news_12g_baidubaike_20g_novel_90g_embedding_64.bin') Traceback (most recent call last): File "/home/qiu/PycharmProjects/ai_law-master (2)/HAN_train.py", line 271, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/home/qiu/PycharmProjects/ai_law-master (2)/HAN_train.py", line 101, in main assign_pretrained_word_embedding(sess, vocabulary_index2word, vocab_size, model,FLAGS.word2vec_model_path,model.Embedding) File "/home/qiu/PycharmProjects/ai_law-master (2)/HAN_train.py", line 238, in assign_pretrained_word_embedding for word, vector in zip(word2vec_model.vocab, word2vec_model.vectors): AttributeError: 'EuclideanKeyedVectors' object has no attribute 'vectors'

brightmart commented 6 years ago

did you follow readMe to download the pretrained word embedding as i mentioned?

tangdouer commented 6 years ago

Yes, I download the pretrained word embedding as you mentioned.

brightmart commented 6 years ago

I did not has this issue.

I am using python3 and this link https://pan.baidu.com/s/1o7MWrnc for word embedding.


发件人: tangdouer notifications@github.com 发送时间: 2018年6月26日 9:21 收件人: brightmart/ai_law 抄送: brightmart; Comment 主题: Re: [brightmart/ai_law] AttributeError: 'EuclideanKeyedVectors' object has no attribute 'vectors' (#3)

Yes, I download the pretrained word embedding as you mentioned.

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbrightmart%2Fai_law%2Fissues%2F3%23issuecomment-400145995&data=02%7C01%7C%7Cc105164e602748a269fb08d5db0326a1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636655728929255394&sdata=1jpegCHiV%2B4grbMYkG78z5qO43UvWD7Qhh59%2FqBQ%2BV0%3D&reserved=0, or mute the threadhttps://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FASuYMPXuIHBto1_QtX5s9jqYn0WVBTHfks5uAYybgaJpZM4U2C1d&data=02%7C01%7C%7Cc105164e602748a269fb08d5db0326a1%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636655728929255394&sdata=wx%2Fnx5yelJVB2wX3jk9FMW1flWGJTuQL1UawZxPtiys%3D&reserved=0.

tangdouer commented 6 years ago

Thank you very much. This problem was solved when using python3