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

if self.controller is not None and ('<new1>' in origin_prompt[0] or '<new1>' in origin_prompt[1]). TypeError: 'NoneType' object is not subscriptable` #8

Open
0Frett opened this issue Dec 10, 2024 · 0 comments

Comments

@0Frett
Copy link

0Frett commented Dec 10, 2024

Hi, when i try to reproduce with the example cat_dog setting, I got the following error.
The origin prompt is None but in run.sh caption=" cat and dog" .
Thanks a lot.
[rank0]: Traceback (most recent call last): [rank0]: File "/data2/frett/repos/DisenDiff/train.py", line 1016, in <module> [rank0]: trainer.fit(model, data) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 553, in fit [rank0]: self._run(model) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 918, in _run [rank0]: self._dispatch() [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 986, in _dispatch [rank0]: self.accelerator.start_training(self) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/accelerators/accelerator.py", line 92, in start_training [rank0]: self.training_type_plugin.start_training(trainer) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 161, in start_training [rank0]: self._results = trainer.run_stage() [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 996, in run_stage [rank0]: return self._run_train() [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1031, in _run_train [rank0]: self._run_sanity_check(self.lightning_module) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1115, in _run_sanity_check [rank0]: self._evaluation_loop.run() [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/loops/base.py", line 111, in run [rank0]: self.advance(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 110, in advance [rank0]: dl_outputs = self.epoch_loop.run( [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/loops/base.py", line 111, in run [rank0]: self.advance(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 110, in advance [rank0]: output = self.evaluation_step(batch, batch_idx, dataloader_idx) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 154, in evaluation_step [rank0]: output = self.trainer.accelerator.validation_step(step_kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/accelerators/accelerator.py", line 211, in validation_step [rank0]: return self.training_type_plugin.validation_step(*step_kwargs.values()) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/plugins/training_type/ddp.py", line 386, in validation_step [rank0]: return self.model(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl [rank0]: return self._call_impl(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl [rank0]: return forward_call(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 1643, in forward [rank0]: else self._run_ddp_forward(*inputs, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 1459, in _run_ddp_forward [rank0]: return self.module(*inputs, **kwargs) # type: ignore[index] [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl [rank0]: return self._call_impl(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl [rank0]: return forward_call(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/pytorch_lightning/overrides/base.py", line 93, in forward [rank0]: output = self.module.validation_step(*inputs, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context [rank0]: return func(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/stable-diffusion/ldm/models/diffusion/ddpm.py", line 359, in validation_step [rank0]: _, loss_dict_no_ema = self.shared_step(batch) [rank0]: File "/data2/frett/repos/DisenDiff/src/model.py", line 588, in shared_step [rank0]: loss = self(x, c, mask=mask) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl [rank0]: return self._call_impl(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/ldm/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl [rank0]: return forward_call(*args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/stable-diffusion/ldm/models/diffusion/ddpm.py", line 879, in forward [rank0]: return self.p_losses(x, c, t, *args, **kwargs) [rank0]: File "/data2/frett/repos/DisenDiff/src/model.py", line 382, in p_losses [rank0]: if self.controller is not None and ('<new1>' in origin_prompt[0] or '<new1>' in origin_prompt[1]): [rank0]: TypeError: 'NoneType' object is not subscriptable

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