williamyang1991 / DualStyleGAN

[CVPR 2022] Pastiche Master: Exemplar-Based High-Resolution Portrait Style Transfer
Other
1.61k stars 249 forks source link

Fine-Tune DualStyleGAN on Target Domain auto terminate #93

Closed KkyKai closed 10 months ago

KkyKai commented 10 months ago

When trying to Fine-Tune DualStyleGAN on Target Domain with

!python /content/drive/MyDrive/DualStyleGAN/finetune_dualstylegan.py --iter 1300 --batch 8 --ckpt /content/drive/MyDrive/DualStyleGAN/checkpoint/generator-pretrain.pt --style_loss 0.25 --CX_loss 0.25 --perc_loss 1 --id_loss 1 --L2_reg_loss 0.015 --augment cartoon

the code automatically terminates.

Error: load model: /content/drive/MyDrive/DualStyleGAN/checkpoint/generator-pretrain.pt Loading pSp from checkpoint: /content/drive/MyDrive/DualStyleGAN/checkpoint/encoder.pt Loading ResNet ArcFace Encoder model successfully loaded! ^C (Terminate here)

The code seems to be unable to run this lines (line 536) Simgs = torch.cat(Simgs, dim=0) # image S

Tried debugging with: for i, tensor in enumerate(Simgs): print(f"Tensor {i + 1}: Size={tensor.size()}, Dtype={tensor.dtype}") Where output is Tensor xxx: Size=torch.Size([1, 3, 1024, 1024]), Dtype=torch.float32 ^C

KkyKai commented 10 months ago

Solved! Seems to be not enough System Ram for concatenation of tensor with 300+ images. At least16gb system ram required