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

Error occur when training toy example #417

Open
koojahyeok opened this issue Oct 14, 2024 · 2 comments
Open

Error occur when training toy example #417

koojahyeok opened this issue Oct 14, 2024 · 2 comments

Comments

@koojahyeok
Copy link

Hi, I'm trying to train examples using the configurations in configs/example_training.

When I use yaml files such as imagenet-f8_cond.yaml or txt2img-clipl.yaml, there are no issues.
However, when I try using a yaml file located in configs/example_training/toy, I encounter the following error: ' AttributeError: 'IdentityFirstStage' object has no attribute 'decoder'. Did you mean: 'decode'?'.

They occur in sgm/models/diffusion.py at line 126.
The current line is if isinstance(self.first_stage_model.decoder, VideoDecoder): which results in the error.

Examples such as imagenet or txt2img-clipl use sgm.models.autoencoder.AutoencoderKL, which has decoder attribute . However, the examples located in configs/example_training/toy use sgm.models.autoencoder.IdentityFirstStage, which lacks the decoder attribute.

I believe a possible solution is to modify the code at sgm/models/diffusion.py line 126 to the following:
if hasattr(self.first_stage_model, 'decoder') and isinstance(self.first_stage_model.decoder, VideoDecoder):.

Thank you!

@xiexh20
Copy link

xiexh20 commented Oct 27, 2024

check out this pull request: #245
it solves my problem.

@koojahyeok
Copy link
Author

But it solve just for code running...
I think my idea would solve original problem.

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

2 participants