lllyasviel / ControlNet-v1-1-nightly

Nightly release of ControlNet 1.1
4.78k stars 377 forks source link

RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)` #19

Closed My12123 closed 1 year ago

My12123 commented 1 year ago
(control-v11) M:\ControlNet-v1-1-nightly>python gradio_lineart_anime.py
logging improved.
Enabled sliced_attention.
logging improved.
Enabled clip hacks.
No module 'xformers'. Proceeding without it.
ControlLDM: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Loaded model config from [./models/control_v11p_sd15s2_lineart_anime.yaml]
Loaded state_dict from [./models/anything-v3-full.safetensors]
Loaded state_dict from [./models/control_v11p_sd15s2_lineart_anime.pth]
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Global seed set to 12345
Traceback (most recent call last):
  File "F:\2\envs\control-v11\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "F:\2\envs\control-v11\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "F:\2\envs\control-v11\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "F:\2\envs\control-v11\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "F:\2\envs\control-v11\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "F:\2\envs\control-v11\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "gradio_lineart_anime.py", line 65, in process
    cond = {"c_concat": [control], "c_crossattn": [model.get_learned_conditioning([prompt + ', ' + a_prompt] * num_samples)]}
  File "M:\ControlNet-v1-1-nightly\ldm\models\diffusion\ddpm.py", line 667, in get_learned_conditioning
    c = self.cond_stage_model.encode(c)
  File "M:\ControlNet-v1-1-nightly\ldm\modules\encoders\modules.py", line 131, in encode
    return self(text)
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "M:\ControlNet-v1-1-nightly\cldm\hack.py", line 65, in _hacked_clip_forward
    y = transformer_encode(feed)
  File "M:\ControlNet-v1-1-nightly\cldm\hack.py", line 42, in transformer_encode
    rt = self.transformer(input_ids=t, output_hidden_states=True)
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\2\envs\control-v11\lib\site-packages\transformers\models\clip\modeling_clip.py", line 722, in forward
    return self.text_model(
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\2\envs\control-v11\lib\site-packages\transformers\models\clip\modeling_clip.py", line 643, in forward
    encoder_outputs = self.encoder(
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\2\envs\control-v11\lib\site-packages\transformers\models\clip\modeling_clip.py", line 574, in forward
    layer_outputs = encoder_layer(
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\2\envs\control-v11\lib\site-packages\transformers\models\clip\modeling_clip.py", line 317, in forward
    hidden_states, attn_weights = self.self_attn(
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\2\envs\control-v11\lib\site-packages\transformers\models\clip\modeling_clip.py", line 209, in forward
    query_states = self.q_proj(hidden_states) * self.scale
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\2\envs\control-v11\lib\site-packages\torch\nn\modules\linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`