FoundationVision / LlamaGen

Autoregressive Model Beats Diffusion: 🦙 Llama for Scalable Image Generation
https://arxiv.org/abs/2406.06525
MIT License
1.08k stars 39 forks source link

Error in FID evaluation #20

Open Artanic30 opened 1 month ago

Artanic30 commented 1 month ago

Hi, I'm running FID evaluation code by following command

bash scripts/autoregressive/sample_c2i.sh --vq-ckpt ./pretrained_models/vq_ds16_c2i.pt --gpt-ckpt ./pretrained_models/c2i_B.pt --gpt-model GPT-B --image-size 384 --image-size-eval 256 --cfg-scale 2.0

This code will raise following error

torch._dynamo.exc.Unsupported: dynamic shape operator: aten.repeat_interleave.Tensor                                                                                                                                                     

from user code:                                                                                                                                                                                                                          
   File "/data1/qlt/LlamaGen/autoregressive/models/gpt.py", line 255, in forward                                                                                                                                                         
    h = x + self.drop_path(self.attention(self.attention_norm(x), freqs_cis, start_pos, mask))                                                                                                                                           
  File "/data1/qlt/LlamaGen/autoregressive/models/gpt.py", line 229, in forward                                                                                                                                                          
    keys = keys.repeat_interleave(self.n_head // self.n_kv_head, dim=1) 

I notice this error iscaused by the default args in autoregressive/sample/sample_c2i_ddp.py where torch compile is set to True by default.

       parser.add_argument("--compile", action='store_true', default=True)

The scripts can work by setting this --compile to False. I'm wondering if this is due to my environment or it's a bugs in codes.

PeizeSun commented 1 month ago

Hi~ Can you reproduce our reported FID performance by setting --compile to False?

Artanic30 commented 1 month ago

Thanks for fast reply. I'm currenting testing reproduced models, maybe I will try it later.