Uminosachi/sd-webui-inpaint-anything

AUTOMATIC1111 Colab Extension Error Pytorch

Closed this issue · 2 comments

Hello everyone,
I have a problem with the installation of inpaint anything extension in combination with Automatic1111 in Googl Colab Pro.

Procedure:

  1. installation in Google Colab Pro with the following workbook (https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb)
  2. for analysis purposes and to avoid dependency errors with other extensions (e.g. train tool), I use the installed version without other extensions
  3. start SD. Everything works.
  4. install extension, reload ui -> error:

*** Error loading script: inpaint_anything.py Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1146, in _get_module file (str, optional): The file to join with the path. Defaults to "__init__.py". File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.10/dist-packages/transformers/models/speecht5/modeling_speecht5.py", line 37, in <module> from ...pytorch_utils import torch_int_div ImportError: cannot import name 'torch_int_div' from 'transformers.pytorch_utils' (/usr/local/lib/python3.10/dist-packages/transformers/pytorch_utils.py)

  1. if I interpret the error correctly, "torch_int_div" is missing in "transformers/pytorch_utils.py".
  2. does anyone have an idea how to add the missing element or get inpaint anything to work?

Found finally solution by myself on the Web: [(https://github.com/huggingface/transformers/issues/28189)]
For me, installing transformers was the solution:
!pip3 install git+https://github.com/huggingface/transformers.git # to install transformers !pip3 install transformers[torch] # to install accelerate>=0.21.0

can be closed