aigc-apps / sd-webui-EasyPhoto

📷 EasyPhoto | Your Smart AI Photo Generator.
Apache License 2.0
4.92k stars 387 forks source link

[Bug]: ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 动态链接库(DLL)初始化例程失败。 #438

Open xxliucong opened 1 month ago

xxliucong commented 1 month ago

Is there an existing issue for this?

Is EasyPhoto the latest version?

What happened?

训练LORA时报错提示:ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 动态链接库(DLL)初始化例程失败。具体如下:

Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common causes and solutions. If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\extensions\sd-webui-EasyPhoto\scripts\train_kohya\train_lora.py", line 42, in from diffusers import DDPMScheduler, DPMSolverMultistepScheduler, StableDiffusionInpaintPipeline File "", line 1075, in _handle_fromlist File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 701, in getattr value = getattr(module, name) File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 701, in getattr value = getattr(module, name) File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 700, in getattr module = self._get_module(self._class_to_module[name]) File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 712, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_inpaint because of the following error (look up to see its traceback): Failed to import transformers.models.clip.image_processing_clip because of the following error (look up to see its traceback): Traceback (most recent call last): File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 70, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 动态链接库(DLL)初始化例程失败。

Steps to reproduce the problem

  1. 点击开始训练之后报错

What should have happened?

正常完成训练

Commit where the problem happens

webui: EastPhoto:

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

List of enabled extensions

9ea002e08caeda21ff70b0003324d34

Console logs

Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\extensions\sd-webui-EasyPhoto\scripts\train_kohya\train_lora.py", line 42, in <module>
    from diffusers import DDPMScheduler, DPMSolverMultistepScheduler, StableDiffusionInpaintPipeline
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 701, in __getattr__
    value = getattr(module, name)
  File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 701, in __getattr__
    value = getattr(module, name)
  File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 700, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\diffusers\utils\import_utils.py", line 712, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_inpaint because of the following error (look up to see its traceback):
Failed to import transformers.models.clip.image_processing_clip because of the following error (look up to see its traceback):
Traceback (most recent call last):
  File "D:\sd-webui-aki-v4.8\sd-webui-aki-v4.8\sd-webui-aki-v4.8\python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 70, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 动态链接库(DLL)初始化例程失败。

Additional information

No response

l378500947 commented 1 day ago

我也遇到了,不知道如何解决

l378500947 commented 1 day ago

我在主板BIOS设置里打开了AVX2指令集,这个报错消失了,你可以尝试一下。 I opened the AVX2 Instruction Set Architecture in the main board BIOS settings, and this error disappeared. You can try it.