sjtuplayer / anomalydiffusion

[AAAI 2024] AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model
MIT License
114 stars 14 forks source link

请问多大的内存可以避免CUDA out of memory问题? #35

Open zhujiyu opened 3 months ago

zhujiyu commented 3 months ago

我用一张11GB内存的1080Ti卡,试图训练anomaly generation model,执行下面的命令,无法解决这个内存问题。

CUDA_VISIBLE_DEVICES=$gpu_id python main.py --spatial_encoder_embedding --data_enhance --base configs/latent-diffusion/txt2img-1p4B-finetune-encoder+embedding.yaml -t --actual_resume models/ldm/text2img-large/model.ckpt -n test --gpus 0, --init_word anomaly --mvtec_path=$path_to_mvtec_dataset

请教大家,都是在什么卡上跑通的,最低要多大的内存?

sjtuplayer commented 3 months ago

你好,默认的batchsize应该需要至少24g的卡来训练,11g的话可以尝试调小batch size

zhujiyu commented 3 months ago

调小batch size,需要调到1,又会出现weights尺寸不对的问题。