UserWarning: detected Windows; aliasing chunkize to chunkize_serial warnings.warn("detected Windows;

使用Word2vec时遇到这个问题怎么办UserWarning: detected Windows; aliasing chunkize to chunkize_serial
warnings.warn("detected Windows; aliasing chunkize to chunkize_serial")?

在加载word2vec前写如下内容忽略警告就可以了
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')

至于为什么会遇到这种情况,官方给出的解释是这样的:

Some algorithms in Gensim (mostly the distributed/parallelized versions) call a function called chunkize, which splits an input stream of records into batches. It works in a streaming manner (lazy batch iteration). chunkize has an optional parameter that can actively prepare and buffer data batches in advance: not quite lazy, but also not eager (buffers a limited fixed number of batches in advance).

This optional functionality is not available on Windows, because it uses multi-processing and is slower. So on Windows, only chunkize_serial is available (no buffering). It's aliased to chunkize for API compatibility reason.

This is a rather technical point, related to performance on slow I/O input streams on Windows. You can probably ignore it.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值