Git Product home page Git Product logo

Comments (9)

linjiadegou2 avatar linjiadegou2 commented on June 3, 2024 9

pip install diffusers==0.24.0

from mmagic.

lewishaas avatar lewishaas commented on June 3, 2024 1

I think this is an issue with the diffusers library. I commented out the line referring to controlnet_xs in site-packages/diffusers/pipelines/__init__.py and it worked afterward. I didn't change the diffusers version

from mmagic.

linjiadegou2 avatar linjiadegou2 commented on June 3, 2024

Hello, I also encountered this problem just now, I reduced the diffusers version to 0.24.0 and this error did not occur.

from mmagic.

carlomigliorini avatar carlomigliorini commented on June 3, 2024

I had the same problem, I installed diffusers==0.24.0 and the problem has been solved, but now I get a new error:
ModuleNotFoundError: No module named 'mmcv._ext'
The mmcv version is 2.0.1.
Any idea please ?

from mmagic.

leozjr avatar leozjr commented on June 3, 2024

followed by this offical guide.
I had the same problem, installed diffusers==0.24.0 not work.

/home/leo/.conda/envs/leo_inpainting/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_5m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/leo/.conda/envs/leo_inpainting/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_11m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_11m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/leo/.conda/envs/leo_inpainting/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/leo/.conda/envs/leo_inpainting/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_384 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_384. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/leo/.conda/envs/leo_inpainting/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_512 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_512. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
Traceback (most recent call last):
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/test.py", line 2, in <module>
    sd_inferencer = MMagicInferencer(model_name='stable_diffusion')
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/apis/mmagic_inferencer.py", line 147, in __init__
    self.inferencer = Inferencers(
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/apis/inferencers/__init__.py", line 81, in __init__
    self.inferencer = Text2ImageInferencer(
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/apis/inferencers/base_mmagic_inferencer.py", line 59, in __init__
    register_all_modules()
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/utils/setup_env.py", line 25, in register_all_modules
    import mmagic.evaluation  # noqa: F401,F403
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/evaluation/__init__.py", line 2, in <module>
    from .evaluator import Evaluator
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/evaluation/evaluator.py", line 12, in <module>
    from .metrics.base_gen_metric import GenMetric
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/evaluation/metrics/__init__.py", line 12, in <module>
    from .niqe import NIQE, niqe
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/evaluation/metrics/niqe.py", line 12, in <module>
    from mmagic.datasets.transforms import MATLABLikeResize
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/datasets/transforms/__init__.py", line 2, in <module>
    from .albu_function import AlbuCorruptFunction, PairedAlbuTransForms
  File "/home/leo/MentorWorks/ImageInpainting/MMLab/mmagic/mmagic/datasets/transforms/albu_function.py", line 4, in <module>
    import albumentations as albu
ModuleNotFoundError: No module named 'albumentations'

after pip install albumentations:

raise EnvironmentError(
OSError: runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.

from mmagic.

umaximu avatar umaximu commented on June 3, 2024

i'm having the same issue! i'm on a macbook air (m1), have followed several different official guides, and am about to try changing my python model with pyenv. which version of python have y'all been running?

from mmagic.

hullout avatar hullout commented on June 3, 2024

pip install diffusers==0.24.0

it works, thanks

from mmagic.

mcsmart76 avatar mcsmart76 commented on June 3, 2024

I have not been able to resolve the issue with diffusers=0.24.0 nor by commenting out the controlnet_xs line.

I think this is an issue with the diffusers library. I commented out the line referring to controlnet_xs in site-packages/diffusers/pipelines/__init__.py and it worked afterward. I didn't change the diffusers version

This got me to a new error message: ModuleNotFoundError: No module named 'mmcv._ext'

My full repro from head using virtual Python environments:

$ cat ~/mmagic.sh 
#!/bin/bash

VENV=~/.mmagic

# To cleanup, run `deactivate` and `rm -r $VENV`.

# Create my virtual environment at $VENV and activate it.
python3 -m venv $VENV
source $VENV/bin/activate

# Dependency installs, trying to be as up to date as possible.
pip3 install 'torch>=2.3.0'
pip3 install torchvision
pip3 install -U openmim
# mmcv was bumped to 2.2.0 on 2024-04-16, which is incompatible
# with mmengine's version check as of 2024-04-25.
# https://github.com/open-mmlab/mmcv/pull/3087/commits
mim install 'mmcv>=2.0.0,<=2.1.0'
mim install mmengine
mim install mmagic

# Validate imports.
echo "torch working?"
python -c "import torch; print(torch.rand(5))"
echo
echo "mmagic working?"
python -c "import mmagic; print(mmagic.__version__)"
python -c "from mmagic.apis import MMagicInferencer"

from mmagic.

mcsmart76 avatar mcsmart76 commented on June 3, 2024

I was able to get things working with the addition of:

# Make sure we aren't caching wheels so mmcv builds the .so.
pip3 cache purge
pip3 install wheel

and changing mim install 'mmcv>=2.0.0,<=2.1.0' to:

# Use pip3 instead of mim to cause .so to be built.
#
# mmcv was bumped to 2.2.0 on 2024-04-16, which is incompatible
# with mmengine's version check as of 2024-04-25.
# https://github.com/open-mmlab/mmcv/pull/3087/commits
pip3 install 'mmcv>=2.0.0,<=2.1.0'

I also ran into #2110 for which I added:

pip3 install 'diffusers==0.24.0'

The full working script with a Python virtual environment is:

$ cat mmagic.sh
#!/bin/bash

VENV=~/.mmagic

# To cleanup, run `deactivate` and `rm -r $VENV`.

# Create my virtual environment at $VENV and activate it.
python3 -m venv $VENV
source $VENV/bin/activate

# Make sure we aren't caching wheels so mmcv builds the .so.
pip3 cache purge
pip3 install wheel

pip3 install torch
pip3 install torchvision
pip3 install -U openmim

# Use pip3 instead of mim to cause .so to be built.
#
# mmcv was bumped to 2.2.0 on 2024-04-16, which is incompatible
# with mmengine's version check as of 2024-04-25.
# https://github.com/open-mmlab/mmcv/pull/3087/commits
pip3 install 'mmcv>=2.0.0,<=2.1.0'

mim install mmengine
mim install mmagic

# https://github.com/open-mmlab/mmagic/issues/2110#issuecomment-1871812155
#
# Fixed "'No module named 'diffusers.pipelines.controlnet_xs'" issue by
# downgrading to 0.24.0.
pip3 install 'diffusers==0.24.0'

# Needed for the example at
# https://github.com/open-mmlab/mmagic/blob/main/docs/en/get_started/quick_run.md
pip3 install albumentations
pip3 install accelerate              

# Validate imports.
echo "torch working?"
python -c "import torch; print(torch.rand(5))"
echo
echo "mmagic working?"
python -c "import mmagic; print(mmagic.__version__)"
python -c "from mmagic.apis import MMagicInferencer"

echo
echo "source $VENV/bin/activate"

from mmagic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.