Help please: RuntimeError: Boolean value of Tensor with more than one value is ambiguous #14256
Unanswered
xXSuperSnakerXx
asked this question in
Q&A
Replies: 1 comment 1 reply
-
same here. my repro is import torch
from diffusers import DiffusionPipeline
device = "cpu"
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
model = DiffusionPipeline.from_pretrained(model_id).to(device)
random_input = torch.randn(1, 4, 256, 256).to(device)
timestep = torch.tensor([1.0]).to(device)
encoder_hidden_states = torch.randn(1, 1, 2048).to(device)
added_cond_kwargs = {
"text_embeds": torch.randn(1, 2560).to(device), # Example tensor, adjust shape as needed
"time_ids": torch.tensor([1]).to(device) # Replace 'some_value' with the appropriate value or tensor shape for time_ids
}
args = (random_input, timestep, encoder_hidden_states, None, None, None, None, added_cond_kwargs)
image = model(*args) Error: (ptca) root@e9b784a5c219:/opt/pytorch# python test_sdxl.py
/opt/conda/envs/ptca/lib/python3.11/site-packages/transformers/utils/generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
_torch_pytree._register_pytree_node(
[2024-02-20 20:43:25,716] [INFO] [real_accelerator.py:158:get_accelerator] Setting ds_accelerator to cuda (auto detect)
/opt/conda/envs/ptca/lib/python3.11/site-packages/transformers/utils/generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
_torch_pytree._register_pytree_node(
/opt/conda/envs/ptca/lib/python3.11/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
torch.utils._pytree._register_pytree_node(
/opt/conda/envs/ptca/lib/python3.11/site-packages/transformers/utils/generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
_torch_pytree._register_pytree_node(
/opt/conda/envs/ptca/lib/python3.11/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
torch.utils._pytree._register_pytree_node(
Loading pipeline components...: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:01<00:00, 4.48it/s]
Traceback (most recent call last):
File "/opt/pytorch/test_sdxl.py", line 18, in <module>
image = fake_model(*fake_args)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pytorch/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/ptca/lib/python3.11/site-packages/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py", line 1076, in __call__
height = height or self.default_sample_size * self.vae_scale_factor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Boolean value of Tensor with more than one value is ambiguous |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i have an error
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
I searched information but i can fix it, anyone know how fix this error?
Before this error i execute "Git pull" in cmd for update automatic 1111, after that stable diffusion gives this error, i reinstalled python and automatic 1111 but this error persist.
Anyone can help me?... Thanks...
Beta Was this translation helpful? Give feedback.
All reactions