【问题标题】:Warning when using saved Word2Vec model使用保存的 Word2Vec 模型时发出警告
【发布时间】:2018-10-13 14:46:09
【问题描述】:

运行此代码时出现此警告

model.save('raw_gutenberg_model.w2v')
model = gensim.models.Word2Vec.load('raw_gutenberg_model.w2v')
model['dog']

错误:

"/home/computer_name/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:1: DeprecationWarning: Call to deprecated `doesnt_match` (Method will be removed in 4.0.0, use self.wv.doesnt_match() instead).
  """Entry point for launching an IPython kernel."

【问题讨论】:

  • 这只是一个警告,而不是错误。这里没有什么可回答的。
  • 是的,我知道这是警告,我提到了这个我只是想知道为什么会出现这个警告

标签: python machine-learning deep-learning anaconda natural-language-processing


【解决方案1】:

出现此警告是因为指定的函数将在 gensim 的未来版本中被弃用,而作者希望用户清楚这一点。

您可以使用以下方法禁用这些警告:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-14
    • 1970-01-01
    • 2011-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-26
    • 1970-01-01
    相关资源
    最近更新 更多