styleGAN2 MemoryError: Unable to allocate 0 bytes for an array with shape (1073741824, 0)

25 篇文章 1 订阅
9 篇文章 0 订阅

错误信息

Traceback (most recent call last):
  File "C:/Users/78753/Desktop/stylegan2encoder/project_images.py", line 129, in <module>
    main()
  File "C:/Users/78753/Desktop/stylegan2encoder/project_images.py", line 118, in main
    project_image(proj, src_file, args.dst_dir, args.tmp_dir, video=args.video)
  File "C:/Users/78753/Desktop/stylegan2encoder/project_images.py", line 30, in project_image
    max_label_size=0, repeat=False, shuffle_mb=0
  File "C:\Users\78753\Desktop\stylegan2encoder\training\dataset.py", line 192, in load_dataset
    dataset = dnnlib.util.get_obj_by_name(class_name)(**kwargs)
  File "C:\Users\78753\Desktop\stylegan2encoder\training\dataset.py", line 86, in __init__
    self._np_labels = np.zeros([1<<30, 0], dtype=np.float32)
MemoryError: Unable to allocate 0 bytes for an array with shape (1073741824, 0) and data type float32

Process finished with exit code 1

发现./training/dataset.py这里居然要

self._np_labels = np.zeros([1<<30, 0], dtype=np.float32)

1<<30 == 1073741824 == 1G
我内存挺紧张的,禁不起这么几下.
1<<30 改成 1<<20 (styleGAN1 就是这样的)

self._np_labels = np.zeros([1<<20, 0], dtype=np.float32)

就能跑动了,好像也没什么副作用?

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值