YangLing0818 / RPG-DiffusionMaster

[ICML 2024] Mastering Text-to-Image Diffusion: Recaptioning, Planning, and Generating with Multimodal LLMs (PRG)
https://arxiv.org/abs/2401.11708
1.59k stars 91 forks source link

Error occurs for parsing gpt4's response #50

Open Genie-Kim opened 1 month ago

Genie-Kim commented 1 month ago

Thanks for sharing your great work.

However, when I run RPG.py, I get an error like below.

NameError: name 'final_split_ratio' is not defined

I've tried changing the regex in mllm.py's get_params_dict function, but gpt4's response is giving me a response that doesn't match it, so I frequently get parsing errors. like this :

### Final Output

**Overall split ratio:**
1;1;1

This is also the case with the regional prompt.

If anyone has solved this, please help😭

CindyTing commented 1 month ago

Similar Error I got,

Traceback (most recent call last): File "/run/determined/workdir/home/RPG-DiffusionMaster/test.py", line 51, in <module> images = pipe( File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/run/determined/workdir/home/RPG-DiffusionMaster/RegionalDiffusion_base.py", line 901, in __call__ matrixdealer(self,self.split_ratio,self.base_ratio) File "/run/determined/workdir/home/RPG-DiffusionMaster/matrix.py", line 248, in matrixdealer baseratio = baseratio2

UnboundLocalError: local variable 'baseratio2' referenced before assignment

HuiZhang0812 commented 3 days ago

I have also encountered similar problems, whether using llama or gpt4.