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

not able to create embedding if having --medvram #2399

Closed
D-06 opened this issue Oct 12, 2022 · 1 comment
Closed

not able to create embedding if having --medvram #2399

D-06 opened this issue Oct 12, 2022 · 1 comment
Labels
not-an-issue This issue is not with the repo itself.

Comments

@D-06
Copy link

D-06 commented Oct 12, 2022

Describe the bug
when i create embedding it just give me error with no explain

To Reproduce
Steps to reproduce the behavior:

  1. Go to train
  2. Click on create embedding
  3. See error

Expected behavior
create a *.pt file

Desktop (please complete the following information):

  • OS: windows
  • Browser :chrome
  • Commit revision : cc58036

log

Traceback (most recent call last):\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 694, in call_fu
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 275, in run_predictprediction = await anyio.to_thread.run_sync(
    output = await app.blocks.process_api(diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sy
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 785, in process_apireturn await get_asynclib().run_sync_in_worker_thread(
    result = await self.call_function(fn_index, inputs, iterator)b\site-packages\anyio\_backends\_asyncio.py", line 937,
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 694, in call_functionturn await future
    prediction = await anyio.to_thread.run_sync(ion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867,
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync  result = context.run(func, *args)
    return await get_asynclib().run_sync_in_worker_thread(modules\textual_inversion\ui.py", line 11, in create_embedding
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_threadsktop\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 159, in
    return await future
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run"C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1130,
    result = context.run(func, *args)
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\modules\textual_inversion\ui.py", line 11, in create_embedding
    filename = modules.textual_inversion.textual_inversion.create_embedding(name, nvpt, init_text=initialization_text),
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 159, in create_embeddingedding(
    embedded = embedding_layer.token_embedding.wrapped(ids.to(devices.device)).squeeze(0)\functional.py", line 2199, in
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_implch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
    return forward_call(*input, **kwargs)on the same device, but found at least two devices, cpu and cuda:0! (when check
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\sparse.py", line 158, in forward
    return F.embedding(
  File "C:\Users\1nterland\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\nn\functional.py", line 2199, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)
@D-06 D-06 added the bug-report Report of a bug, yet to be confirmed label Oct 12, 2022
@D-06 D-06 changed the title not able to create embendding not able to create embedding Oct 12, 2022
@D-06 D-06 changed the title not able to create embedding not able to create embedding if having --medvram Oct 12, 2022
@ClashSAN
Copy link
Collaborator

this is known, and only works half the time. its not supposed to run on --medvram, but there have been some reports of it working with it on

@ClashSAN ClashSAN added not-an-issue This issue is not with the repo itself. and removed bug-report Report of a bug, yet to be confirmed labels Oct 13, 2022
Atry pushed a commit to Atry/stable-diffusion-webui that referenced this issue Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-an-issue This issue is not with the repo itself.
Projects
None yet
Development

No branches or pull requests

2 participants