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

VQModel issue in training VAR #16

Open
YannX1e opened this issue Feb 25, 2025 · 0 comments
Open

VQModel issue in training VAR #16

YannX1e opened this issue Feb 25, 2025 · 0 comments

Comments

@YannX1e
Copy link

YannX1e commented Feb 25, 2025

Thanks for your great work!
I just followed the training code for XQGAN using "configs/MSVR10P2-4096.yaml". After training VQModel, I try to training VAR following given command in README.md.
But I got the Error as:

[rank2]: Traceback (most recent call last):
[rank2]:   File "***/ImageFolder/train.py", line 362, in <module>
[rank2]:     try: main_training()
[rank2]:   File "***/ImageFolder/train.py", line 209, in main_training
[rank2]:     stats, (sec, remain_time, finish_time) = train_one_ep(
[rank2]:   File "***/ImageFolder/train.py", line 331, in train_one_ep
[rank2]:     grad_norm, scale_log2 = trainer.train_step(
[rank2]:   File "***/ImageFolder/trainer.py", line 122, in train_step
[rank2]:     gt_idx_Bl_list = self.vae_local.img_to_idxBl(inp_B3HW)
[rank2]:   File "/home/ubuntu/anaconda3/envs/var/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in __getattr__
[rank2]:     raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
[rank2]: AttributeError: 'VQModel' object has no attribute 'img_to_idxBl'

I find self.vae_local is built from function build_everything, which return a class VQModel as vae_local, code in "models/__init__.py" as bellow:

# build models
# vae_local = VQVAE(vocab_size=V, z_channels=Cvae, ch=ch, test_mode=True, share_quant_resi=share_quant_resi, v_patch_nums=patch_nums).to(device)
vae_local = VQ_models['VQ-16'](...)

Attribute img_to_idxBl can be found in class VQVAE, but xqtrain.py is the training script for the class VQModel, why?

Environment:
Ubuntu 22.04 LTS
conda environment as described in “environment.yml”

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

1 participant