nod-ai / SHARK

SHARK - High Performance Machine Learning Distribution
Apache License 2.0
1.41k stars 168 forks source link

Couldn't get the SHARK web ui running #1569

Open johanesalxd opened 1 year ago

johanesalxd commented 1 year ago

Hi, can you help me with the error below? I've tried different models but the error is similar:

Found device AMD Radeon RX 6800 XT. Using target triple rdna2-unknown-windows.
Using tuned models for stabilityai/stable-diffusion-2-1/fp16/vulkan://00000000-0a00-0000-0000-000000000000.
Downloading (…)cheduler_config.json: 100%|████████████████████████████████████████████████████| 345/345 [00:00<?, ?B/s]
loading existing vmfb from: D:\username\Downloads\shark\euler_scale_model_input_1_512_512_vulkan_fp16.vmfb
loading existing vmfb from: D:\username\Downloads\shark\euler_step_1_512_512_vulkan_fp16.vmfb
use_tuned? sharkify: True
_1_64_512_512_fp16_tuned_stable-diffusion-2-1-base
Traceback (most recent call last):
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 71, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\username/.cache\\huggingface\\hub\\models--stabilityai--stable-diffusion-2-1\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gradio\routes.py", line 401, in run_predict
  File "gradio\blocks.py", line 1302, in process_api
  File "gradio\blocks.py", line 1039, in call_function
  File "anyio\to_thread.py", line 31, in run_sync
  File "anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
  File "anyio\_backends\_asyncio.py", line 867, in run
  File "gradio\utils.py", line 491, in async_iteration
  File "ui\txt2img_ui.py", line 146, in txt2img_inf
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 338, in from_pretrained
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 43, in __init__
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 75, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\username/.cache\\huggingface\\hub\\models--stabilityai--stable-diffusion-2-1\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'
Found device AMD Radeon RX 6800 XT. Using target triple rdna2-unknown-windows.
Using tuned models for CompVis/stable-diffusion-v1-4/fp16/vulkan://00000000-0a00-0000-0000-000000000000.
Downloading (…)cheduler_config.json: 100%|████████████████████████████████████████████████████| 313/313 [00:00<?, ?B/s]
loading existing vmfb from: D:\username\Downloads\shark\euler_scale_model_input_1_512_512_vulkan_fp16.vmfb
loading existing vmfb from: D:\username\Downloads\shark\euler_step_1_512_512_vulkan_fp16.vmfb
use_tuned? sharkify: True
_1_64_512_512_fp16_tuned_stable-diffusion-v1-4
Downloading (…)ain/unet/config.json: 100%|█████████████████████████████████████████████| 743/743 [00:00<00:00, 739kB/s]
Downloading (…)ch_model.safetensors: 100%|████████████████████████████████████████| 3.44G/3.44G [01:55<00:00, 29.7MB/s]
mat1 and mat2 shapes cannot be multiplied (128x1024 and 768x320)
Retrying with a different base model configuration
Loading Winograd config file from  C:\Users\username\.local/shark_tank/configs\unet_winograd_vulkan.json
100%|███████████████████████████████████████████████████████████████████████████████████| 107/107 [00:00<00:00, 386B/s]
100%|█████████████████████████████████████████████████████████████████████████████████| 107/107 [00:00<00:00, 16.4kB/s]
Loading lowering config file from  C:\Users\username\.local/shark_tank/configs\unet_v1_4_fp16_vulkan_rdna2.json
100%|█████████████████████████████████████████████████████████████████████████████| 24.6k/24.6k [00:00<00:00, 64.4kB/s]
100%|█████████████████████████████████████████████████████████████████████████████| 24.6k/24.6k [00:00<00:00, 1.97MB/s]
Applying tuned configs on unet_1_64_512_512_fp16_tuned_stable-diffusion-v1-4_vulkan
No vmfb found. Compiling and saving to D:\username\Downloads\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-v1-4_vulkan.vmfb
Using target triple -iree-vulkan-target-triple=rdna2-unknown-windows from command line args
Saved vmfb in D:\username\Downloads\shark\unet_1_64_512_512_fp16_tuned_stable-diffusion-v1-4_vulkan.vmfb.
Traceback (most recent call last):
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 71, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\username/.cache\\huggingface\\hub\\models--CompVis--stable-diffusion-v1-4\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gradio\routes.py", line 401, in run_predict
  File "gradio\blocks.py", line 1302, in process_api
  File "gradio\blocks.py", line 1039, in call_function
  File "anyio\to_thread.py", line 31, in run_sync
  File "anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
  File "anyio\_backends\_asyncio.py", line 867, in run
  File "gradio\utils.py", line 491, in async_iteration
  File "ui\txt2img_ui.py", line 146, in txt2img_inf
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 338, in from_pretrained
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 43, in __init__
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 75, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\username/.cache\\huggingface\\hub\\models--CompVis--stable-diffusion-v1-4\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

Thanks!

powderluv commented 1 year ago

Looks like some 🤗 issue. Can you please try to clear your HF cache

johanesalxd commented 1 year ago

hi @powderluv ! yes i've cleared the cache (deleted this C:\\Users\\username/.cache folder) couple of times, restarting the process but the results are the same 🤔 So i'm not sure what the issue is.

johanesalxd commented 1 year ago

Hi, some update from me: it seems the advanced installation is working just fine for me:

image

So wondering if the problem is within the release version itself. Thanks!

SpencerCurtis commented 1 year ago

I'm having the same issue here. 5800X and 7900 XTX. Deleting the cache folder did not help either. Hope this helps in solving the problem!


WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
Traceback (most recent call last):
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 71, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\Spencer/.cache\\huggingface\\hub\\models--CompVis--stable-diffusion-v1-4\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gradio\routes.py", line 401, in run_predict
  File "gradio\blocks.py", line 1302, in process_api
  File "gradio\blocks.py", line 1039, in call_function
  File "anyio\to_thread.py", line 31, in run_sync
  File "anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
  File "anyio\_backends\_asyncio.py", line 867, in run
  File "gradio\utils.py", line 491, in async_iteration
  File "ui\txt2img_ui.py", line 146, in txt2img_inf
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 338, in from_pretrained
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 43, in __init__
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 75, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\Spencer/.cache\\huggingface\\hub\\models--CompVis--stable-diffusion-v1-4\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'
MattBach commented 1 year ago

Same issue here with the release WebUI and CLI .exe's. Clearing the .cache folder doesn't change anything. With the WebUI, I can launch the web interface, but I get the error as soon as I try to generate an image.

WebUI error:

Found device NVIDIA GeForce RTX 2080. Using target triple turing-rtx2080-windows.
Tuned models are currently not supported for this setting.
Downloading (…)cheduler_config.json: 100%|█████████████████████████████████████████████| 345/345 [00:00<00:00, 345kB/s]
huggingface_hub\file_download.py:133: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\mattb\.cache\huggingface\hub. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations.
To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to see activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
failed to download model, falling back and using import_mlir
loading existing vmfb from: C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark\euler_scale_model_input_1_512_512_vulkan_fp16.vmfb
WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
loading existing vmfb from: C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark\euler_step_1_512_512_vulkan_fp16.vmfb
WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
use_tuned? sharkify: False
_1_64_512_512_fp16_stable-diffusion-2-1-base
safetensors\torch.py:99: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
Traceback (most recent call last):
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 71, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\mattb/.cache\\huggingface\\hub\\models--stabilityai--stable-diffusion-2-1\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gradio\routes.py", line 401, in run_predict
  File "gradio\blocks.py", line 1302, in process_api
  File "gradio\blocks.py", line 1039, in call_function
  File "anyio\to_thread.py", line 31, in run_sync
  File "anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
  File "anyio\_backends\_asyncio.py", line 867, in run
  File "gradio\utils.py", line 491, in async_iteration
  File "ui\txt2img_ui.py", line 146, in txt2img_inf
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 338, in from_pretrained
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 43, in __init__
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 75, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
    resolved_vocab_files[file_id] = cached_file(
                                    ^^^^^^^^^^^^
  File "transformers\utils\hub.py", line 409, in cached_file
    resolved_file = hf_hub_download(
                    ^^^^^^^^^^^^^^^^
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\mattb/.cache\\huggingface\\hub\\models--stabilityai--stable-diffusion-2-1\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

CLI error:

Found device NVIDIA GeForce RTX 2080. Using target triple turing-rtx2080-windows.
Tuned models are currently not supported for this setting.
failed to download model, falling back and using import_mlir
loading existing vmfb from: C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark\euler_scale_model_input_1_512_512_vulkan_fp16.vmfb
WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
loading existing vmfb from: C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark\euler_step_1_512_512_vulkan_fp16.vmfb
WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
use_tuned? sharkify: False
_1_64_512_512_fp16_stable-diffusion-2-1-base
safetensors\torch.py:99: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
WARNING: [Loader Message] Code 0 : windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
Traceback (most recent call last):
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 71, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
  File "transformers\utils\hub.py", line 409, in cached_file
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\mattb/.cache\\huggingface\\hub\\models--stabilityai--stable-diffusion-2-1-base\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps\stable_diffusion\scripts\main.py", line 11, in <module>
  File "apps\stable_diffusion\scripts\txt2img.py", line 25, in main
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 338, in from_pretrained
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_txt2img.py", line 43, in __init__
  File "apps\stable_diffusion\src\pipelines\pipeline_shark_stable_diffusion_utils.py", line 75, in __init__
  File "apps\stable_diffusion\src\models\opt_params.py", line 120, in get_tokenizer
  File "transformers\tokenization_utils_base.py", line 1770, in from_pretrained
  File "transformers\utils\hub.py", line 409, in cached_file
  File "huggingface_hub\utils\_validators.py", line 120, in _inner_fn
  File "huggingface_hub\file_download.py", line 1302, in hf_hub_download
  File "filelock\_api.py", line 260, in __enter__
  File "filelock\_api.py", line 217, in acquire
  File "filelock\_windows.py", line 25, in _acquire
OSError: [Errno 22] Invalid argument: 'C:\\Users\\mattb/.cache\\huggingface\\hub\\models--stabilityai--stable-diffusion-2-1-base\\blobs\\W/"469be27c5c010538f845f518c4f5e8574c78f7c8.lock'
[24600] Failed to execute script 'main' due to unhandled exception!

Unlike alexanderv21, however, I couldn't get the advanced installation working either. Error when I try to run index.py:

python .\index.py
Traceback (most recent call last):
  File "C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark_Advanced\apps\stable_diffusion\web\index.py", line 11, in <module>
    from apps.stable_diffusion.src import args, clear_all
  File "C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark_Advanced\apps\stable_diffusion\src\__init__.py", line 1, in <module>
    from apps.stable_diffusion.src.utils import (
  File "C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark_Advanced\apps\stable_diffusion\src\utils\__init__.py", line 12, in <module>
    from apps.stable_diffusion.src.utils.sd_annotation import sd_model_annotation
  File "C:\GitHub_Sync\PugetBench-for-Stable-Diffusion\Shark_Advanced\apps\stable_diffusion\src\utils\sd_annotation.py", line 3, in <module>
    from shark.model_annotation import model_annotation, create_context
ModuleNotFoundError: No module named 'shark'