Skip to content

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

@D-06

Description

@D-06

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-an-issueThis issue is not with the repo itself.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions