Comments (9)
pip install diffusers==0.24.0
from mmagic.
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.
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.
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.
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.
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.
pip install diffusers==0.24.0
it works, thanks
from mmagic.
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
insite-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.
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)
- [Bug] RealBasic got killed when loading model
- [Docs] The link MMEditing in the README redirects back to the same mmagic page
- [Bug] cyclegan:UnboundLocalError: local variable 'init_info' referenced before assignment HOT 2
- [Feature] The code and documentation are really terrible[Docs] HOT 1
- [Bug] - ImportError: /opt/conda/envs/mmagic/lib/python3.9/site-packages/mmcv/_ext.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationESs
- [Docs] BasicVSR++ HOT 1
- torch.cuda.OutOfMemoryError: CUDA out of memory.real_basicvsr/basicvsr++运行报错 HOT 2
- [Bug] Can not use `ConcatImageVisualizer` in train step. / 在Train阶段可视化存在bug
- [Feature] Training and Testing Support for Stable Diffusion
- [Bug] When I RUN the "QUICK RUN" in the documentation, something goes wrong
- [Bug] CUBLAS_STATUS_EXECUTION_FAILED error for BasicVSR_PP for tasks with resolutions >~1700x1080
- [Bug] Can not work HOT 1
- [Bug] BasicVSR++ epoch display
- Too long data_time in training of denoise and deblur models. And too low GPU utilization
- [Bug] linux环境,运行视频超分程序,中断 HOT 1
- ['AsymmetricAutoencoderKL is already registered in model at mmagic.models.archs'] HOT 2
- 文生图Demo执行后output图片生成不出来[Bug] HOT 1
- Swinir training configuration issue?[Bug] HOT 1
- [Bug] AttributeError: 'EditDDIMScheduler' object has no attribute 'sample_timestep'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmagic.