‘Word2Vec‘ object has no attribute ‘syn0‘

学习kaggle时发现教程的代码运行不了,报错为:

'Word2Vec' object has no attribute 'syn0'

错误代码:

print(model.syn0,shape)

改正:

print(model.wv.vectors.shape)

原因:

gensim4版本更新,以前的syn0貌似换成vectors了

你可能感兴趣的:(bug,word2vec,python,人工智能)