open-mmlab / mmagic

OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox. Unlock the magic 🪄: Generative-AI (AIGC), easy-to-use APIs, awsome model zoo, diffusion models, for text-to-image generation, image/video restoration/enhancement, etc.
https://mmagic.readthedocs.io/en/latest/
Apache License 2.0
6.85k stars 1.05k forks source link

[Bug] The official example reported an error #1825

Closed bobo0810 closed 1 year ago

bobo0810 commented 1 year ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmagic

Environment

sys.platform: linux Python: 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) [GCC 9.4.0] CUDA available: True numpy_random_seed: 2147483648 GPU 0,1: NVIDIA GeForce RTX 2080 Ti CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.6, V11.6.55 GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 PyTorch: 1.11.0a0+17540c5 PyTorch compiling details: PyTorch built with:

TorchVision: 0.12.0a0 OpenCV: 4.2.0 MMEngine: 0.7.2 MMCV: 2.0.0 MMCV Compiler: GCC 9.3 MMCV CUDA Compiler: 11.6 MMagic: 1.0.0+c24769f

Reproduces the problem - code sample

from mmagic.apis import MMagicInferencer

sd_inferencer = MMagicInferencer(model_name="stable_diffusion")
text_prompts = "A panda is having dinner at KFC"
result_out_dir = "output/sd_res.png"
sd_inferencer.infer(text=text_prompts, result_out_dir=result_out_dir)

Reproduces the problem - command or script

from mmagic.apis import MMagicInferencer

sd_inferencer = MMagicInferencer(model_name="stable_diffusion")
text_prompts = "A panda is having dinner at KFC"
result_out_dir = "output/sd_res.png"
sd_inferencer.infer(text=text_prompts, result_out_dir=result_out_dir)

Reproduces the problem - error message

image

Additional information

No response

bobo0810 commented 1 year ago

diffusers 0.16.0 transformers 4.22.1

Z-Fran commented 1 year ago

please update transformers: such as pip install transformers==4.27.4 @bobo0810

Z-Fran commented 1 year ago

Closing this issue since the bug has been fixed in a merged pull request. Please feel free to reopen it if it has not been fixed.

bobo0810 commented 1 year ago

@Z-Fran Hello,the same error is reported after installing the following dependencies

pip install accelerate

bobo0810 commented 1 year ago

An error occurs after the accelerate package is installed. The system runs normally after uninstallation

image

Z-Fran commented 1 year ago

image This warning means it can't import diffusers, please check it. @bobo0810