Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some issues and solutions #20

Open
strive789 opened this issue Dec 7, 2024 · 3 comments
Open

Some issues and solutions #20

strive789 opened this issue Dec 7, 2024 · 3 comments

Comments

@strive789
Copy link

Your paper is great and inspired me to replicate your experimental results. However, I encountered some issues while reproducing your code, which took me some time to resolve. I believe the maintenance of the code on GitHub could be improved. Below, I list the issues I encountered and the solutions I applied, which may serve as a reference for others attempting to replicate the code.

1.The command pip install requirements.txt should be modified to pip install -r requirements.txt. This is a minor issue.
2.The ImageNet 2012 validation dataset doesn't have the grouping format required by your code. I had to reorganize the ImageNet validation set according to your val_condition groups. It would be great if you could provide a convenient method for dividing the validation dataset.
3.The GPU version of your code lacks several components, such as the validate function, which forced me to port code from the HPU version. This is not very user-friendly for GPU users. I hope the GPU version of the code can be more complete in the future.
4.The biggest issue I encountered: when following your code, the conditions I provided during inference didn't seem to take effect. The images generated in each batch were highly similar and did not reflect the specified conditions. After debugging for a long time, I found that the problem was with the random seed setting during inference. In the current code, the seed is fixed during conditional inference, which causes the generated images in different batches to be nearly identical.
To fix this, I modified the 'pix_cond_inference' function as follows:
images = var.module.conditional_infer_cfg(
B=B,
label_B=conditions,
cfg=guidance_scale,
top_k=top_k,
top_p=top_p,
g_seed=None,
c_mask=c_mask,
c_img=c_img,
cond_type=cond_type
)
I changed g_seed=seed to g_seed=None, which allows the images to be generated correctly according to the provided conditions.

I hope this will be helpful for those who replicate the code in the future, and I look forward to the author's future papers!

@lxa9867
Copy link
Owner

lxa9867 commented Dec 7, 2024

Hi, thanks for the suggestions that will definitely help us to improve the quality of the codebase. We will incorporate your suggestions shortly.

@qiuk2

@bigshuimu
Copy link

hi, I encountered some difficulties while using train_control_var.py for inference. Could you provide your modified train_control_var.py? Thank you.

@bigshuimu
Copy link

hi, I encountered some difficulties while using train_control_var.py for inference. Could you provide your modified train_control_var.py? Thank you.

I tried adding some missing functions and code, such as resume, to train_control_var.py, which resolved the issue I was facing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants