V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
coolair
V2EX  ›  问与答

关于 numpy memory error 的问题

  •  
  •   coolair · 2019 年 2 月 23 日 · 1055 次点击
    这是一个创建于 2603 天前的主题,其中的信息可能已经有所发展或是发生改变。
    代码如下:
    x = numpy.asarray(image.convert('RGBA')).copy()
    x[:, :, 3] = (255 * (x[:, :, :3] != 255).any(axis=2)).astype(numpy.uint8)

    当 x 非常大时,小内存的机器上就会因为内存不足而 memory error,有什么好办法优化吗?
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5535 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:45 · PVG 16:45 · LAX 01:45 · JFK 04:45
    ♥ Do have faith in what you're doing.