TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.47k stars 1.3k forks source link

ImportError: cannot import name 'get_device' from 'basicsr.utils.misc' (/usr/local/lib/python3.8/dist-packages/basicsr/utils/misc.py) #1524

Open rabbit9001 opened 1 year ago

rabbit9001 commented 1 year ago

hi, I got the following problem : Error setting up CodeFormer: Traceback (most recent call last): File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stable-diffusion-webui/modules/codeformer_model.py", line 38, in setup_model from facelib.utils.face_restoration_helper import FaceRestoreHelper File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stablediffusion/src/codeformer/facelib/utils/face_restoration_helper.py", line 7, in from facelib.detection import init_detection_model File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stablediffusion/src/codeformer/facelib/detection/init.py", line 10, in from .retinaface.retinaface import RetinaFace File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stablediffusion/src/codeformer/facelib/detection/retinaface/retinaface.py", line 14, in from basicsr.utils.misc import get_device ImportError: cannot import name 'get_device' from 'basicsr.utils.misc' (/usr/local/lib/python3.8/dist-packages/basicsr/utils/misc.py)

TheLastBen commented 1 year ago

it's just a warning I'll fix it soon

rabbit9001 commented 1 year ago

Thank you very much.

After I installed using "!pip install basicsr" , an out- of-order error occurred.

Traceback (most recent call last): File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 794, in main() File "/content/diffusers/examples/dreambooth/train_dreambooth.py", line 436, in main accelerator = Accelerator( File "/usr/local/lib/python3.8/dist-packages/accelerate/accelerator.py", line 286, in init raise ValueError(err.format(mode="fp16", requirement="a GPU")) ValueError: fp16 mixed precision requires a GPU Traceback (most recent call last): File "/usr/local/bin/accelerate", line 8, in sys.exit(main()) File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/accelerate_cli.py", line 43, in main args.func(args) File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 837, in launch_command simple_launcher(args) File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 354, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['/usr/bin/python3', '/content/diffusers/examples/dreambooth/train_dreambooth.py', '--stop_text_encoder_training=250', '--image_captions_filename', '--train_only_unet', '--save_starting_step=500', '--save_n_steps=0', '--Session_dir=/content/gdrive/MyDrive/Fast-Dreambooth/Sessions/test_diana', '--pretrained_model_name_or_path=/content/stable-diffusion-v1-5', '--instance_data_dir=/content/gdrive/MyDrive/Fast-Dreambooth/Sessions/test_diana/instance_images', '--output_dir=/content/models/test_diana', '--captions_dir=/content/gdrive/MyDrive/Fast-Dreambooth/Sessions/test_diana/captions', '--instance_prompt=', '--seed=458037', '--resolution=512', '--mixed_precision=fp16', '--train_batch_size=1', '--gradient_accumulation_steps=1', '--use_8bit_adam', '--learning_rate=5e-06', '--lr_scheduler=linear', '--lr_warmup_steps=0', '--max_train_steps=2000']' returned non-zero exit status 1. Something went wrong

I think there is a problem with version compatibility. Because when installing basicsr, there is the following error message:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorboard 2.9.1 requires tensorboard-data-server<0.7.0,>=0.6.0, but you have tensorboard-data-server 0.7.0 which is incompatible.

CharlesFeo commented 1 year ago

hi, I got the following problem : Error setting up CodeFormer: Traceback (most recent call last): File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stable-diffusion-webui/modules/codeformer_model.py", line 38, in setup_model from facelib.utils.face_restoration_helper import FaceRestoreHelper File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stablediffusion/src/codeformer/facelib/utils/face_restoration_helper.py", line 7, in from facelib.detection import init_detection_model File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stablediffusion/src/codeformer/facelib/detection/init.py", line 10, in from .retinaface.retinaface import RetinaFace File "/content/gdrive/MyDrive/Fast-Dreambooth/sd_db/stablediffusion/src/codeformer/facelib/detection/retinaface/retinaface.py", line 14, in from basicsr.utils.misc import get_device ImportError: cannot import name 'get_device' from 'basicsr.utils.misc' (/usr/local/lib/python3.8/dist-packages/basicsr/utils/misc.py)

me too .When I click on 'genarater' I get an error: Something went wrong Expecting value: line 1 column 1 (char 0). stable-diffusion-webui is not working properly