open-mmlab / OpenUnReID

PyTorch open-source toolbox for unsupervised or domain adaptive object re-ID.
Apache License 2.0
396 stars 67 forks source link

关于CUDA out of memory. Tried to allocate 18.00 MiB (GPU 0; 5.80 GiB total capacity; 4.98 GiB already allocated; 4.25 MiB free; 9.66 MiB cached) #17

Closed GJTNB closed 4 years ago

GJTNB commented 4 years ago

我的硬件配置是1660ti,6g显存,训练命令是 GPUS=1 bash dist_train.sh CycleGAN mark_duck,我修改了配置文件里的iter次数,还是显示内存不足,请问是硬件配置不行吗?但是我跑cyclegan作者的模型是可以训练的。

yxgeee commented 4 years ago

你好,请修改这里samples_per_gpu(cyclegan原代码的话这里应该是1,但是我为了训练更快修改了一下,你可以根据自己的硬件情况酌情减小这个值) https://github.com/open-mmlab/OpenUnReID/blob/master/tools/CycleGAN/config.yaml#L69

另外,iters是跟显存无关的

GJTNB commented 4 years ago

非常感谢,可以了。