Closed DeerFee closed 3 months ago
Installing torch 2.3.0 fixed the issue for me.
I tried torch 2.3.1 and 2.1.2 and I get another error : "AttributeError: module 'torch.library' has no attribute 'register_fake'"
(Windows 10 with AMD GPU so using --device=GPU
)
Title: OSError when importing torch: fbgemm.dll not found
When trying to run iopaint, I'm encountering an OSError related to the torch library. The error occurs when importing torch, specifically when trying to load the fbgemm.dll file.
Environment:
Error message: OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
Full traceback: 2024-08-02 16:59:00.867 | INFO | iopaint.runtime:setup_model_dir:82 - Model directory: C:\Users\user.cache
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\typer_config\decorators. │ │ py:92 in wrapped │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\iopaint\cli.py:164 in │ │ start │ │ │ │ 161 │ │ os.environ["TRANSFORMERS_OFFLINE"] = "1" │ │ 162 │ │ os.environ["HF_HUB_OFFLINE"] = "1" │ │ 163 │ │ │ ❱ 164 │ from iopaint.download import cli_download_model, scan_models │ │ 165 │ │ │ 166 │ scanned_models = scan_models() │ │ 167 │ if model not in [it.name for it in scanned_models]: │ │ │ │ C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\iopaint\download.py:19 │ │ in │
│ │
│ 16 │ DIFFUSERS_SDXL_INPAINT_CLASS_NAME, │
│ 17 │ ANYTEXT_NAME, │
│ 18 ) │
│ ❱ 19 from iopaint.model.original_sd_configs import get_config_files │
│ 20 │
│ 21 │
│ 22 def cli_download_model(model: str): │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\iopaint\model__init__.p │
│ y:1 in │
│ │
│ ❱ 1 from .anytext.anytext_model import AnyText │
│ 2 from .controlnet import ControlNet │
│ 3 from .fcf import FcF │
│ 4 from .instruct_pix2pix import InstructPix2Pix │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\iopaint\model\anytext\an │
│ ytext_model.py:1 in │
│ │
│ ❱ 1 import torch │
│ 2 from huggingface_hub import hf_hub_download │
│ 3 │
│ 4 from iopaint.const import ANYTEXT_NAME │
│ │
│ C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch__init__.py:148 in │
│ │
│ │
│ 145 │ │ │ if res is None: │
│ 146 │ │ │ │ err = ctypes.WinError(ctypes.get_last_error()) │
│ 147 │ │ │ │ err.strerror += f' Error loading "{dll}" or one of its dependencies.' │
│ ❱ 148 │ │ │ │ raise err │
│ 149 │ │
│ 150 │ kernel32.SetErrorMode(prev_error_mode) │
│ 151 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
OSError: [WinError 126] The specified module could not be found. Error loading
"C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\lib\fbgemm.dll" or one of its
dependencies.
Steps to reproduce:
Expected behavior: iopaint should start without errors.
Actual behavior: The application crashes with the OSError mentioned above.
Additional notes:
Any help or guidance on resolving this issue would be greatly appreciated.